From b546a5c1f1793833fedbcecc593fd5edd1943c30 Mon Sep 17 00:00:00 2001 From: Ladygin Sergey Date: Fri, 20 Aug 2021 00:43:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20github=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/go.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8d0e369..a6136e2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -4,7 +4,11 @@ on: push: branches: - master - - v1.0 + pull_request: + branches: + - master + release: + types: [ published ] jobs: test: @@ -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: @@ -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 \ No newline at end of file + tags: updev/polkovnik-bot:${{ github.event.release.tag_name }} \ No newline at end of file