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
on: [push, pull_request]
on:
push:
branches:
- '**'
tags:
- '**'
- '!v[0-9]+.[0-9]+.[0-9]+'
pull_request:
jobs:
test_build:
name: Test and build

View file

@ -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