Build my own ansible image
All checks were successful
Build and push docker image / build (push) Successful in 2m11s
All checks were successful
Build and push docker image / build (push) Successful in 2m11s
This commit is contained in:
parent
4a4a36a744
commit
02422a42a8
42
.gitea/workflows/build.yml
Normal file
42
.gitea/workflows/build.yml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
name: Build and push docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "${{ gitea.workflow }}-${{ gitea.repository }}"
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
if: gitea.event.pull_request.draft == false
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
DOCKER_REGISTRY: git.aww.cloud
|
||||||
|
DOCKER_IMAGE: git.aww.cloud/${{ gitea.repository }}
|
||||||
|
steps:
|
||||||
|
- name: Login to Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ${{ env.DOCKER_REGISTRY }}
|
||||||
|
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
run: |
|
||||||
|
# Build the image with the commit hash tag
|
||||||
|
docker build --build-arg BUILD_IDENTIFIER=${{ gitea.sha }} -t ${{ env.DOCKER_IMAGE }}:${{ gitea.sha }} .
|
||||||
|
docker tag ${{ env.DOCKER_IMAGE }}:${{ gitea.sha }} ${{ env.DOCKER_IMAGE }}:latest
|
||||||
|
|
||||||
|
- name: Push Docker Images
|
||||||
|
run: |
|
||||||
|
docker push ${{ env.DOCKER_IMAGE }}:${{ gitea.sha }}
|
||||||
|
docker push ${{ env.DOCKER_IMAGE }}:latest
|
||||||
|
|
||||||
|
- name: Log out from registry
|
||||||
|
if: always()
|
||||||
|
run: docker logout ${{ env.DOCKER_REGISTRY }}
|
||||||
Loading…
Reference in New Issue
Block a user