From fa8f946ff5936192f18d9b610753890e43392755 Mon Sep 17 00:00:00 2001 From: Avior Date: Sat, 25 Nov 2023 22:00:09 +0000 Subject: [PATCH] Update .github/workflows/build_and_check.yml --- .github/workflows/build_and_check.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_check.yml b/.github/workflows/build_and_check.yml index 948ac13..8078f7f 100644 --- a/.github/workflows/build_and_check.yml +++ b/.github/workflows/build_and_check.yml @@ -2,9 +2,13 @@ name: Build, check & Test on: push: - branches: [ "master" ] + branches: + - master + tags: + - v* pull_request: - branches: [ "master" ] + branches: + - master jobs: run: @@ -13,8 +17,20 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: git.dzeio.com/avior/avior.me + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} - name: Login to Docker Hub + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: git.dzeio.com @@ -28,6 +44,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . + push: ${{ github.event_name != 'pull_request' }} file: ./Dockerfile.static - push: true - tags: git.dzeio.com/avior/avior.me:latest \ No newline at end of file + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file