From 7be6d1cf945d89ec0d3604e220bae209544f6351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20St=C4=99pie=C5=84?= Date: Thu, 6 May 2021 16:36:05 +0200 Subject: [PATCH 01/14] WIP: add github workflow for deployment --- .github/workflows/deploy.yml | 89 ++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..a0285e68 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,89 @@ +name: Deploy to Demo and Test +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v1 + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: "12.x" + + # Build for demo + - name: Build and publish demo docker image + if: github.ref == 'refs/heads/demo' + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: demo-storefrontcloud-io/vue-storefront-api:${{ github.sha }} + registry: registry.storefrontcloud.io + username: ${{ secrets.CLOUD_USERNAME }} + password: ${{ secrets.CLOUD_PASSWORD }} + dockerfile: docker/vue-storefront-api/docker/vue-storefront-api/Dockerfile + buildoptions: "--compress" + + # Build for test + - name: Build and publish test docker image + if: github.ref == 'refs/heads/test' + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: test-storefrontcloud-io/vue-storefront-api:${{ github.sha }} + registry: registry.vuestorefront.io + username: ${{ secrets.CLOUD_USERNAME }} + password: ${{ secrets.CLOUD_PASSWORD }} + dockerfile: docker/vue-storefront-api/docker/vue-storefront-api/Dockerfile + buildoptions: "--compress" + + deploy: + runs-on: ubuntu-latest + needs: build + steps: + - uses: chrnorm/deployment-action@releases/v1 + name: Create GitHub deployment for ${GITHUB_REF##*/} + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' + id: deployment + with: + token: "${{ github.token }}" + target_url: https://${GITHUB_REF##*/}.europe-west1.gcp.storefrontcloud.io + environment: production + initial_status: in_progress + + # Deploy on test/demo depending on the branch that triggered the workflow + - name: Deploy on ${GITHUB_REF##*/}.europe-west1.gcp.storefrontcloud.io + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' + run: | + if curl -s -H 'X-User-Id: ${{ secrets.CLOUD_USERNAME }}' -H 'X-Api-Key: ${{ secrets.CLOUD_PASSWORD }}' -H 'Content-Type: application/json' -X POST -d ' + { + "code":"${GITHUB_REF##*/}", + "region":"europe-west1.gcp", + "frontContainerVersion":"${{ github.sha }}" + }' https://farmer.storefrontcloud.io/instances | grep -q '{"code":200,"result":"Instance updated!"}'; then + echo "Instance updated" + else + echo "Something went wrong during the update process..." + exit 1 + fi + + - name: Update deployment status (success) + if: success() + uses: chrnorm/deployment-status@releases/v1 + with: + token: "${{ github.token }}" + target_url: https://${GITHUB_REF##*/}.europe-west1.gcp.storefrontcloud.io + state: "success" + description: Congratulations! The deploy is done. + deployment_id: ${{ steps.deployment.outputs.deployment_id }} + - name: Update deployment status (failure) + if: failure() + uses: chrnorm/deployment-status@releases/v1 + with: + token: "${{ github.token }}" + target_url: https://${GITHUB_REF##*/}.europe-west1-southeast1.gcp.storefrontcloud.io + description: Unfortunately, the instance hasn't been updated. + state: "failure" + deployment_id: ${{ steps.deployment.outputs.deployment_id }} From 7b58a005dbbafd59c206a64698f4368c1cce60a1 Mon Sep 17 00:00:00 2001 From: byakku Date: Fri, 7 May 2021 13:03:40 +0200 Subject: [PATCH 02/14] Update deploy.yml --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a0285e68..e3ecad53 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,7 +17,7 @@ jobs: # Build for demo - name: Build and publish demo docker image - if: github.ref == 'refs/heads/demo' +# if: github.ref == 'refs/heads/demo' uses: elgohr/Publish-Docker-Github-Action@master with: name: demo-storefrontcloud-io/vue-storefront-api:${{ github.sha }} @@ -29,7 +29,7 @@ jobs: # Build for test - name: Build and publish test docker image - if: github.ref == 'refs/heads/test' +# if: github.ref == 'refs/heads/test' uses: elgohr/Publish-Docker-Github-Action@master with: name: test-storefrontcloud-io/vue-storefront-api:${{ github.sha }} From 7dc2f597e0a2c8820841036fa1bebbda1faa76cd Mon Sep 17 00:00:00 2001 From: byakku Date: Fri, 7 May 2021 13:23:12 +0200 Subject: [PATCH 03/14] Update deploy.yml --- .github/workflows/deploy.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e3ecad53..861c4a58 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,8 +1,7 @@ name: Deploy to Demo and Test -on: - push: - branches: - - main +on: [push, pull_request] +# branches: +# - main jobs: build: From e46193b67333170b9ea954413400ba81dd11015c Mon Sep 17 00:00:00 2001 From: byakku Date: Tue, 11 May 2021 15:43:08 +0200 Subject: [PATCH 04/14] Update deploy.yml --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 861c4a58..8e6094a4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -23,7 +23,7 @@ jobs: registry: registry.storefrontcloud.io username: ${{ secrets.CLOUD_USERNAME }} password: ${{ secrets.CLOUD_PASSWORD }} - dockerfile: docker/vue-storefront-api/docker/vue-storefront-api/Dockerfile + dockerfile: dev/docker/vue-storefront-api/docker/vue-storefront-api/Dockerfile buildoptions: "--compress" # Build for test @@ -35,7 +35,7 @@ jobs: registry: registry.vuestorefront.io username: ${{ secrets.CLOUD_USERNAME }} password: ${{ secrets.CLOUD_PASSWORD }} - dockerfile: docker/vue-storefront-api/docker/vue-storefront-api/Dockerfile + dockerfile: dev/docker/vue-storefront-api/docker/vue-storefront-api/Dockerfile buildoptions: "--compress" deploy: From 838a88a7cdb8f8801e55db106bdd201e68316727 Mon Sep 17 00:00:00 2001 From: byakku Date: Tue, 11 May 2021 15:46:32 +0200 Subject: [PATCH 05/14] Update deploy.yml --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8e6094a4..b9f0d288 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -23,7 +23,7 @@ jobs: registry: registry.storefrontcloud.io username: ${{ secrets.CLOUD_USERNAME }} password: ${{ secrets.CLOUD_PASSWORD }} - dockerfile: dev/docker/vue-storefront-api/docker/vue-storefront-api/Dockerfile + dockerfile: dev/docker/Dockerfile buildoptions: "--compress" # Build for test @@ -35,7 +35,7 @@ jobs: registry: registry.vuestorefront.io username: ${{ secrets.CLOUD_USERNAME }} password: ${{ secrets.CLOUD_PASSWORD }} - dockerfile: dev/docker/vue-storefront-api/docker/vue-storefront-api/Dockerfile + dockerfile: dev/docker/Dockerfile buildoptions: "--compress" deploy: From e81c482d497cb1f7acd80f95aebee2879c3c859d Mon Sep 17 00:00:00 2001 From: byakku Date: Tue, 11 May 2021 15:50:52 +0200 Subject: [PATCH 06/14] Update deploy.yml --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b9f0d288..91250641 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,7 +32,7 @@ jobs: uses: elgohr/Publish-Docker-Github-Action@master with: name: test-storefrontcloud-io/vue-storefront-api:${{ github.sha }} - registry: registry.vuestorefront.io + registry: registry.storefrontcloud.io username: ${{ secrets.CLOUD_USERNAME }} password: ${{ secrets.CLOUD_PASSWORD }} dockerfile: dev/docker/Dockerfile From 1c0235508840964e955c0d748c92ff6aa1b0af0e Mon Sep 17 00:00:00 2001 From: byakku Date: Tue, 11 May 2021 15:57:24 +0200 Subject: [PATCH 07/14] Update deploy.yml --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 91250641..5469e078 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -69,7 +69,7 @@ jobs: fi - name: Update deployment status (success) - if: success() + if: success() && github.ref == 'refs/heads/demo' || success() && github.ref == 'refs/heads/test' uses: chrnorm/deployment-status@releases/v1 with: token: "${{ github.token }}" @@ -78,7 +78,7 @@ jobs: description: Congratulations! The deploy is done. deployment_id: ${{ steps.deployment.outputs.deployment_id }} - name: Update deployment status (failure) - if: failure() + if: failure() && github.ref == 'refs/heads/demo' || failure() && github.ref == 'refs/heads/test' uses: chrnorm/deployment-status@releases/v1 with: token: "${{ github.token }}" From 61b28ed2ca9e1d9fc5756f6db4e354133cd1d2f2 Mon Sep 17 00:00:00 2001 From: byakku Date: Wed, 12 May 2021 14:32:15 +0200 Subject: [PATCH 08/14] Update deploy.yml --- .github/workflows/deploy.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5469e078..82d28e6d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,7 +1,13 @@ name: Deploy to Demo and Test -on: [push, pull_request] -# branches: -# - main +on: + push: + branches: + - test + - demo + pull_request: + branches: + - test + - demo jobs: build: @@ -16,7 +22,7 @@ jobs: # Build for demo - name: Build and publish demo docker image -# if: github.ref == 'refs/heads/demo' + if: github.ref == 'refs/heads/demo' uses: elgohr/Publish-Docker-Github-Action@master with: name: demo-storefrontcloud-io/vue-storefront-api:${{ github.sha }} @@ -28,7 +34,7 @@ jobs: # Build for test - name: Build and publish test docker image -# if: github.ref == 'refs/heads/test' + if: github.ref == 'refs/heads/test' uses: elgohr/Publish-Docker-Github-Action@master with: name: test-storefrontcloud-io/vue-storefront-api:${{ github.sha }} From 24839d1a2dab9cb65b6da3c47325f878e1785a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20St=C4=99pie=C5=84?= Date: Fri, 14 May 2021 13:10:57 +0200 Subject: [PATCH 09/14] Fix branch naming in workflow --- .github/workflows/deploy.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 82d28e6d..83e4cf24 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,12 +2,8 @@ name: Deploy to Demo and Test on: push: branches: - - test - - demo - pull_request: - branches: - - test - - demo + - master + - develop jobs: build: @@ -22,7 +18,7 @@ jobs: # Build for demo - name: Build and publish demo docker image - if: github.ref == 'refs/heads/demo' + if: github.ref == 'refs/heads/master' uses: elgohr/Publish-Docker-Github-Action@master with: name: demo-storefrontcloud-io/vue-storefront-api:${{ github.sha }} @@ -34,7 +30,7 @@ jobs: # Build for test - name: Build and publish test docker image - if: github.ref == 'refs/heads/test' + if: github.ref == 'refs/heads/develop' uses: elgohr/Publish-Docker-Github-Action@master with: name: test-storefrontcloud-io/vue-storefront-api:${{ github.sha }} @@ -50,7 +46,7 @@ jobs: steps: - uses: chrnorm/deployment-action@releases/v1 name: Create GitHub deployment for ${GITHUB_REF##*/} - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' id: deployment with: token: "${{ github.token }}" @@ -60,7 +56,7 @@ jobs: # Deploy on test/demo depending on the branch that triggered the workflow - name: Deploy on ${GITHUB_REF##*/}.europe-west1.gcp.storefrontcloud.io - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' run: | if curl -s -H 'X-User-Id: ${{ secrets.CLOUD_USERNAME }}' -H 'X-Api-Key: ${{ secrets.CLOUD_PASSWORD }}' -H 'Content-Type: application/json' -X POST -d ' { @@ -75,7 +71,7 @@ jobs: fi - name: Update deployment status (success) - if: success() && github.ref == 'refs/heads/demo' || success() && github.ref == 'refs/heads/test' + if: success() && github.ref == 'refs/heads/master' || success() && github.ref == 'refs/heads/develop' uses: chrnorm/deployment-status@releases/v1 with: token: "${{ github.token }}" @@ -84,7 +80,7 @@ jobs: description: Congratulations! The deploy is done. deployment_id: ${{ steps.deployment.outputs.deployment_id }} - name: Update deployment status (failure) - if: failure() && github.ref == 'refs/heads/demo' || failure() && github.ref == 'refs/heads/test' + if: failure() && github.ref == 'refs/heads/master' || failure() && github.ref == 'refs/heads/develop' uses: chrnorm/deployment-status@releases/v1 with: token: "${{ github.token }}" From d4a84b5d7601a73f517e227720e011dde5b75648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20St=C4=99pie=C5=84?= Date: Mon, 17 May 2021 16:40:23 +0200 Subject: [PATCH 10/14] Update deploy.yml --- .github/workflows/deploy.yml | 79 +++++++++++++++++++++++++++++------- 1 file changed, 65 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 83e4cf24..6ecda27e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,27 +40,26 @@ jobs: dockerfile: dev/docker/Dockerfile buildoptions: "--compress" - deploy: + deploy-demo: runs-on: ubuntu-latest needs: build steps: - uses: chrnorm/deployment-action@releases/v1 - name: Create GitHub deployment for ${GITHUB_REF##*/} - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' + if: github.ref == 'refs/heads/master' + name: Create GitHub deployment for demo id: deployment with: token: "${{ github.token }}" - target_url: https://${GITHUB_REF##*/}.europe-west1.gcp.storefrontcloud.io + target_url: https://demo.europe-west1.gcp.storefrontcloud.io environment: production initial_status: in_progress - - # Deploy on test/demo depending on the branch that triggered the workflow - - name: Deploy on ${GITHUB_REF##*/}.europe-west1.gcp.storefrontcloud.io - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' + # Deploy on demo + - name: Deploy on demo.europe-west1.gcp.storefrontcloud.io + if: github.ref == 'refs/heads/master' run: | - if curl -s -H 'X-User-Id: ${{ secrets.CLOUD_USERNAME }}' -H 'X-Api-Key: ${{ secrets.CLOUD_PASSWORD }}' -H 'Content-Type: application/json' -X POST -d ' + if curl -s -u ${{ secrets.DEPLOYMENT_USER }}:${{ secrets.DEPLOYMENT_PASSWORD }} -H 'Content-Type: application/json' -X POST -d ' { - "code":"${GITHUB_REF##*/}", + "code":"demo", "region":"europe-west1.gcp", "frontContainerVersion":"${{ github.sha }}" }' https://farmer.storefrontcloud.io/instances | grep -q '{"code":200,"result":"Instance updated!"}'; then @@ -70,21 +69,73 @@ jobs: exit 1 fi + # Return status - name: Update deployment status (success) - if: success() && github.ref == 'refs/heads/master' || success() && github.ref == 'refs/heads/develop' + if: success() uses: chrnorm/deployment-status@releases/v1 with: token: "${{ github.token }}" - target_url: https://${GITHUB_REF##*/}.europe-west1.gcp.storefrontcloud.io + target_url: https://demo.europe-west1.gcp.storefrontcloud.io state: "success" description: Congratulations! The deploy is done. deployment_id: ${{ steps.deployment.outputs.deployment_id }} + - name: Update deployment status (failure) - if: failure() && github.ref == 'refs/heads/master' || failure() && github.ref == 'refs/heads/develop' + if: failure() uses: chrnorm/deployment-status@releases/v1 with: token: "${{ github.token }}" - target_url: https://${GITHUB_REF##*/}.europe-west1-southeast1.gcp.storefrontcloud.io + target_url: https://demo.europe-west1-southeast1.gcp.storefrontcloud.io description: Unfortunately, the instance hasn't been updated. state: "failure" deployment_id: ${{ steps.deployment.outputs.deployment_id }} + + deploy-test: + runs-on: ubuntu-latest + needs: build + steps: + - uses: chrnorm/deployment-action@releases/v1 + if: github.ref == 'refs/heads/develop' + name: Create GitHub deployment for test + id: deployment + with: + token: "${{ github.token }}" + target_url: https://test.europe-west1.gcp.storefrontcloud.io + environment: production + initial_status: in_progress + # Deploy on demo + - name: Deploy on test.europe-west1.gcp.storefrontcloud.io + if: github.ref == 'refs/heads/develop' + run: | + if curl -s -u ${{ secrets.DEPLOYMENT_USER }}:${{ secrets.DEPLOYMENT_PASSWORD }} -H 'Content-Type: application/json' -X POST -d ' + { + "code":"test", + "region":"europe-west1.gcp", + "frontContainerVersion":"${{ github.sha }}" + }' https://farmer.storefrontcloud.io/instances | grep -q '{"code":200,"result":"Instance updated!"}'; then + echo "Instance updated" + else + echo "Something went wrong during the update process..." + exit 1 + fi + + # Return status + - name: Update deployment status (success) + if: success() + uses: chrnorm/deployment-status@releases/v1 + with: + token: "${{ github.token }}" + target_url: https://test.europe-west1.gcp.storefrontcloud.io + state: "success" + description: Congratulations! The deploy is done. + deployment_id: ${{ steps.deployment.outputs.deployment_id }} + + - name: Update deployment status (failure) + if: failure() + uses: chrnorm/deployment-status@releases/v1 + with: + token: "${{ github.token }}" + target_url: https://test.europe-west1-southeast1.gcp.storefrontcloud.io + description: Unfortunately, the instance hasn't been updated. + state: "failure" + deployment_id: ${{ steps.deployment.outputs.deployment_id }} \ No newline at end of file From 1b70ddad1374f4ab60385346a65d7926fec73ad5 Mon Sep 17 00:00:00 2001 From: byakku Date: Thu, 20 May 2021 20:01:36 +0200 Subject: [PATCH 11/14] Update deploy.yml --- .github/workflows/deploy.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6ecda27e..8b3fb6d9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -50,8 +50,8 @@ jobs: id: deployment with: token: "${{ github.token }}" - target_url: https://demo.europe-west1.gcp.storefrontcloud.io - environment: production + target_url: https://demo.europe-west1.gcp.storefrontcloud.io/api/ + environment: staging initial_status: in_progress # Deploy on demo - name: Deploy on demo.europe-west1.gcp.storefrontcloud.io @@ -61,7 +61,7 @@ jobs: { "code":"demo", "region":"europe-west1.gcp", - "frontContainerVersion":"${{ github.sha }}" + "apiContainerVersion":"${{ github.sha }}" }' https://farmer.storefrontcloud.io/instances | grep -q '{"code":200,"result":"Instance updated!"}'; then echo "Instance updated" else @@ -100,8 +100,8 @@ jobs: id: deployment with: token: "${{ github.token }}" - target_url: https://test.europe-west1.gcp.storefrontcloud.io - environment: production + target_url: https://test.europe-west1.gcp.storefrontcloud.io/api/ + environment: demo initial_status: in_progress # Deploy on demo - name: Deploy on test.europe-west1.gcp.storefrontcloud.io @@ -111,7 +111,7 @@ jobs: { "code":"test", "region":"europe-west1.gcp", - "frontContainerVersion":"${{ github.sha }}" + "apiContainerVersion":"${{ github.sha }}" }' https://farmer.storefrontcloud.io/instances | grep -q '{"code":200,"result":"Instance updated!"}'; then echo "Instance updated" else @@ -138,4 +138,4 @@ jobs: target_url: https://test.europe-west1-southeast1.gcp.storefrontcloud.io description: Unfortunately, the instance hasn't been updated. state: "failure" - deployment_id: ${{ steps.deployment.outputs.deployment_id }} \ No newline at end of file + deployment_id: ${{ steps.deployment.outputs.deployment_id }} From fc2c74d4f45449c6ac71de431e11875c814e32fd Mon Sep 17 00:00:00 2001 From: byakku Date: Mon, 7 Jun 2021 11:32:38 +0200 Subject: [PATCH 12/14] Update workflow --- .github/workflows/deploy.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8b3fb6d9..fbf9f5a2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,9 +15,9 @@ jobs: uses: actions/setup-node@v1 with: node-version: "12.x" - + # Build for demo - - name: Build and publish demo docker image + - name: Build and publish demo docker image if: github.ref == 'refs/heads/master' uses: elgohr/Publish-Docker-Github-Action@master with: @@ -27,7 +27,7 @@ jobs: password: ${{ secrets.CLOUD_PASSWORD }} dockerfile: dev/docker/Dockerfile buildoptions: "--compress" - + # Build for test - name: Build and publish test docker image if: github.ref == 'refs/heads/develop' @@ -51,11 +51,11 @@ jobs: with: token: "${{ github.token }}" target_url: https://demo.europe-west1.gcp.storefrontcloud.io/api/ - environment: staging + environment: production initial_status: in_progress - # Deploy on demo + # Deploy on demo - name: Deploy on demo.europe-west1.gcp.storefrontcloud.io - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/master' run: | if curl -s -u ${{ secrets.DEPLOYMENT_USER }}:${{ secrets.DEPLOYMENT_PASSWORD }} -H 'Content-Type: application/json' -X POST -d ' { @@ -71,7 +71,7 @@ jobs: # Return status - name: Update deployment status (success) - if: success() + if: success() uses: chrnorm/deployment-status@releases/v1 with: token: "${{ github.token }}" @@ -81,7 +81,7 @@ jobs: deployment_id: ${{ steps.deployment.outputs.deployment_id }} - name: Update deployment status (failure) - if: failure() + if: failure() uses: chrnorm/deployment-status@releases/v1 with: token: "${{ github.token }}" @@ -95,7 +95,7 @@ jobs: needs: build steps: - uses: chrnorm/deployment-action@releases/v1 - if: github.ref == 'refs/heads/develop' + if: github.ref == 'refs/heads/develop' name: Create GitHub deployment for test id: deployment with: @@ -103,9 +103,9 @@ jobs: target_url: https://test.europe-west1.gcp.storefrontcloud.io/api/ environment: demo initial_status: in_progress - # Deploy on demo + # Deploy on demo - name: Deploy on test.europe-west1.gcp.storefrontcloud.io - if: github.ref == 'refs/heads/develop' + if: github.ref == 'refs/heads/develop' run: | if curl -s -u ${{ secrets.DEPLOYMENT_USER }}:${{ secrets.DEPLOYMENT_PASSWORD }} -H 'Content-Type: application/json' -X POST -d ' { @@ -121,7 +121,7 @@ jobs: # Return status - name: Update deployment status (success) - if: success() + if: success() uses: chrnorm/deployment-status@releases/v1 with: token: "${{ github.token }}" @@ -131,7 +131,7 @@ jobs: deployment_id: ${{ steps.deployment.outputs.deployment_id }} - name: Update deployment status (failure) - if: failure() + if: failure() uses: chrnorm/deployment-status@releases/v1 with: token: "${{ github.token }}" From b333d1c8040265fd52ae520050444f2fe02faba4 Mon Sep 17 00:00:00 2001 From: byakku Date: Mon, 7 Jun 2021 15:17:07 +0200 Subject: [PATCH 13/14] change auth to header from -u in curl --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fbf9f5a2..437af562 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -57,7 +57,7 @@ jobs: - name: Deploy on demo.europe-west1.gcp.storefrontcloud.io if: github.ref == 'refs/heads/master' run: | - if curl -s -u ${{ secrets.DEPLOYMENT_USER }}:${{ secrets.DEPLOYMENT_PASSWORD }} -H 'Content-Type: application/json' -X POST -d ' + if curl -s -H 'X-User-Id: ${{ secrets.DEPLOYMENT_USER }}' -H 'X-Api-Key: ${{ secrets.DEPLOYMENT_PASSWORD }}' -H 'Content-Type: application/json' -X POST -d ' { "code":"demo", "region":"europe-west1.gcp", @@ -107,7 +107,7 @@ jobs: - name: Deploy on test.europe-west1.gcp.storefrontcloud.io if: github.ref == 'refs/heads/develop' run: | - if curl -s -u ${{ secrets.DEPLOYMENT_USER }}:${{ secrets.DEPLOYMENT_PASSWORD }} -H 'Content-Type: application/json' -X POST -d ' + if curl -s -H 'X-User-Id: ${{ secrets.DEPLOYMENT_USER }}' -H 'X-Api-Key: ${{ secrets.DEPLOYMENT_PASSWORD }}' -H 'Content-Type: application/json' -X POST -d ' { "code":"test", "region":"europe-west1.gcp", From 66c700bd17e482abf14daeadceddaea6b8832ff7 Mon Sep 17 00:00:00 2001 From: byakku Date: Mon, 7 Jun 2021 16:04:22 +0200 Subject: [PATCH 14/14] Update deploy.yml --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 437af562..c6459dbd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -57,7 +57,7 @@ jobs: - name: Deploy on demo.europe-west1.gcp.storefrontcloud.io if: github.ref == 'refs/heads/master' run: | - if curl -s -H 'X-User-Id: ${{ secrets.DEPLOYMENT_USER }}' -H 'X-Api-Key: ${{ secrets.DEPLOYMENT_PASSWORD }}' -H 'Content-Type: application/json' -X POST -d ' + if curl -s -H 'X-User-Id: ${{ secrets.CLOUD_USERNAME }}' -H 'X-Api-Key: ${{ secrets.CLOUD_PASSWORD }}' -H 'Content-Type: application/json' -X POST -d ' { "code":"demo", "region":"europe-west1.gcp", @@ -107,7 +107,7 @@ jobs: - name: Deploy on test.europe-west1.gcp.storefrontcloud.io if: github.ref == 'refs/heads/develop' run: | - if curl -s -H 'X-User-Id: ${{ secrets.DEPLOYMENT_USER }}' -H 'X-Api-Key: ${{ secrets.DEPLOYMENT_PASSWORD }}' -H 'Content-Type: application/json' -X POST -d ' + if curl -s -H 'X-User-Id: ${{ secrets.CLOUD_USERNAME }}' -H 'X-Api-Key: ${{ secrets.CLOUD_PASSWORD }}' -H 'Content-Type: application/json' -X POST -d ' { "code":"test", "region":"europe-west1.gcp",