From fd4a08f75af2e893267e9b923c68861392cc851f Mon Sep 17 00:00:00 2001 From: eikendev Date: Mon, 19 Jul 2021 01:02:37 +0200 Subject: [PATCH] Move guard for tags to push filter in CI --- .github/workflows/main.yml | 9 ++++++++- .github/workflows/publish.yml | 6 ++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 88131f9..96bdb47 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,12 @@ name: Main -on: [push, pull_request] +on: + push: + branches: + - '**' + tags: + - '**' + - '!v[0-9]+.[0-9]+.[0-9]+' + pull_request: jobs: test_build: name: Test and build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 46d173d..f41aa31 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,8 +1,8 @@ name: Publish on: push: - branches: - - master + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' jobs: test_build_publish: name: Test, build, and publish @@ -21,11 +21,9 @@ jobs: - name: Build image run: make build_image - name: Login to Docker Hub - if: ${{ startsWith(github.ref, 'refs/tags/v') }} # Only login for tagged commits. uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Publish image - if: ${{ startsWith(github.ref, 'refs/tags/v') }} # Only publish for tagged commits. run: make push_image