diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 766229b..f25c716 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,6 +3,7 @@ name: Ansible CI on: push: branches: [ master ] + tags: [ 'v*' ] pull_request: branches: [ master ] @@ -31,8 +32,8 @@ jobs: run: ${PWD}/tests/test-ansible-role.sh -d ${{ matrix.distro }} publish: - # Run this job only if the push event is triggered on the default branch - if: github.event_name == 'push' && github.ref == ${{ github.event.repository.default_branch }} + # Run this job only if the push event is triggered by a tag. + if: github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') needs: - test runs-on: ubuntu-latest