Some checks failed
Docker Build / Build and push docker image (push) Failing after 16s
48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
name: Docker Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
REGISTRY_USER: admin
|
|
REGISTRY_PASSWORD: 6nkTT9Th5z6gR?ro
|
|
IMAGE_REGISTRY: hub.docker.xiaohei.one
|
|
IMAGE_TAGS: v1 ${{ github.sha }}
|
|
|
|
jobs:
|
|
build:
|
|
name: Build and push docker image
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: install buildah
|
|
run: apt update && apt install buildah
|
|
|
|
- name: Build Docker Image
|
|
id: build_image
|
|
uses: redhat-actions/buildah-build@v2
|
|
with:
|
|
image: test_devops
|
|
tags: ${{ env.IMAGE_TAGS }}
|
|
registry: ${{ env.IMAGE_REGISTRY }}
|
|
|
|
- name: login to registry
|
|
uses: redhat-actions/podman-login@v1
|
|
with:
|
|
username: ${{ env.REGISTRY_USER }}
|
|
password: ${{ env.REGISTRY_PASSWORD }}
|
|
|
|
- name: push to registry
|
|
uses: redhat-actions/push-to-registry@v2
|
|
with:
|
|
image: ${{ steps.build_image.outputs.image }}
|
|
tags: ${{ steps.build_image.outputs.tags }}
|
|
registry: ${{ env.IMAGE_REGISTRY }} |