From 1c5087d712339db5f99921bc8881afe63fd2876e Mon Sep 17 00:00:00 2001 From: Greg Frasco Date: Tue, 7 Mar 2023 12:05:26 -0500 Subject: [PATCH] feat: update github actions steps --- .github/workflows/admin-client.yml | 11 +++++++++-- .github/workflows/server.yml | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/admin-client.yml b/.github/workflows/admin-client.yml index 7b06ca5..ee6454a 100644 --- a/.github/workflows/admin-client.yml +++ b/.github/workflows/admin-client.yml @@ -47,7 +47,7 @@ jobs: type=semver,pattern={{major}} - name: Login to Docker Hub uses: docker/login-action@v2 - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -60,8 +60,15 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - name: Push to Staging uses: fjogeleit/http-request-action@v1 - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') with: method: "POST" url: ${{ secrets.PORTAINER_WEBHOOK }} preventFailureOnNoResponse: true + - name: Push to Production + uses: fjogeleit/http-request-action@v1 + if: startsWith(github.ref, 'refs/tags/v') + with: + method: "POST" + url: ${{ secrets.PORTAINER_WEBHOOK_PRODUCTION }} + preventFailureOnNoResponse: true diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index 2923779..0e10a25 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -54,7 +54,7 @@ jobs: type=semver,pattern={{major}} - name: Login to Docker Hub uses: docker/login-action@v2 - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -67,8 +67,15 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - name: Push to Staging uses: fjogeleit/http-request-action@v1 - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') with: method: "POST" url: ${{ secrets.PORTAINER_WEBHOOK }} preventFailureOnNoResponse: true + - name: Push to Production + uses: fjogeleit/http-request-action@v1 + if: startsWith(github.ref, 'refs/tags/v') + with: + method: "POST" + url: ${{ secrets.PORTAINER_WEBHOOK_PRODUCTION }} + preventFailureOnNoResponse: true