Skip to content

Commit

Permalink
Доработка github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
updevru committed Aug 19, 2021
1 parent 9758d91 commit b546a5c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ on:
push:
branches:
- master
- v1.0
pull_request:
branches:
- master
release:
types: [ published ]

jobs:
test:
Expand All @@ -24,6 +28,7 @@ jobs:
run: go test -v ./...

deploy:
if: ${{ github.event_name == 'push' || github.event_name == 'release' }}
needs: test
runs-on: ubuntu-latest
steps:
Expand All @@ -40,15 +45,15 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push from mater
if: ${{ github.ref == 'refs/heads/master' }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: docker/build-push-action@v2
with:
push: true
tags: updev/polkovnik-bot:latest

- name: Build and push from v1
if: ${{ github.ref == 'refs/heads/v1.0' }}
- name: Build and push by release
if: ${{ github.event_name == 'release' }}
uses: docker/build-push-action@v2
with:
push: true
tags: updev/polkovnik-bot:v1
tags: updev/polkovnik-bot:${{ github.event.release.tag_name }}

0 comments on commit b546a5c

Please # to comment.