Move guard for tags to push filter in CI

This commit is contained in:
eikendev 2021-07-19 01:02:37 +02:00
parent c2425b239c
commit fd4a08f75a
No known key found for this signature in database
GPG key ID: A1BDB1B28C8EF694
2 changed files with 10 additions and 5 deletions

View file

@ -1,5 +1,12 @@
name: Main name: Main
on: [push, pull_request] on:
push:
branches:
- '**'
tags:
- '**'
- '!v[0-9]+.[0-9]+.[0-9]+'
pull_request:
jobs: jobs:
test_build: test_build:
name: Test and build name: Test and build

View file

@ -1,8 +1,8 @@
name: Publish name: Publish
on: on:
push: push:
branches: tags:
- master - 'v[0-9]+.[0-9]+.[0-9]+'
jobs: jobs:
test_build_publish: test_build_publish:
name: Test, build, and publish name: Test, build, and publish
@ -21,11 +21,9 @@ jobs:
- name: Build image - name: Build image
run: make build_image run: make build_image
- name: Login to Docker Hub - name: Login to Docker Hub
if: ${{ startsWith(github.ref, 'refs/tags/v') }} # Only login for tagged commits.
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish image - name: Publish image
if: ${{ startsWith(github.ref, 'refs/tags/v') }} # Only publish for tagged commits.
run: make push_image run: make push_image