This commit is contained in:
parent
786377ed9c
commit
556fab3336
@ -1,4 +1,5 @@
|
||||
name: Docker Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@ -7,13 +8,38 @@ on:
|
||||
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 Docker Image
|
||||
name: Build and push docker image
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build Docker Image
|
||||
run: docker build -t my-app:test .
|
||||
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 }}
|
||||
Loading…
x
Reference in New Issue
Block a user