From f9023b0ce6ac04cb1ad050f1efc712b944e6389b Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 11:57:48 -0700 Subject: [PATCH 1/5] WIP: CD create beta release pr --- .github/workflows/cd-dev-stage.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index 1ced1be06b..3602d22e86 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -111,7 +111,7 @@ jobs: uses: rtCamp/action-slack-notify@v2 env: SLACK_CHANNEL: code-deploy - SLACK_COLOR: "#FF0000" + SLACK_COLOR: "#36a64f" SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." SLACK_TITLE: Stage Deployment for manager-ui @@ -122,11 +122,15 @@ jobs: runs-on: ubuntu-latest needs: [deploy_dev, deploy_stage] steps: - - uses: actions/checkout@v4 - name: Create Beta Release PR - uses: peter-evans/create-pull-request@v6 - with: - branch: dev - base: beta - title: Beta Release - # labels: + run: gh pr create -B beta -H dev --title 'Beta Release' --body 'Created by Github action' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - uses: actions/checkout@v4 + # - name: Create Beta Release PR + # uses: peter-evans/create-pull-request@v6 + # with: + # branch: dev + # base: beta + # title: Beta Release + # # labels: From 28854eff69ece94cfaff2fad08825e033f9f0541 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 12:08:48 -0700 Subject: [PATCH 2/5] fix: CD create beta release pr --- .github/workflows/cd-dev-stage.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index 3602d22e86..32d2a7044e 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -105,7 +105,7 @@ jobs: success_deploy_notification_to_slack: runs-on: ubuntu-latest if: ${{ success() }} - needs: [deploy_stage] + needs: [deploy_dev, deploy_stage] steps: - name: Success Deploy Notification To Slack uses: rtCamp/action-slack-notify@v2 @@ -122,6 +122,8 @@ jobs: runs-on: ubuntu-latest needs: [deploy_dev, deploy_stage] steps: + - name: Checkout Repo + uses: actions/checkout@v2 - name: Create Beta Release PR run: gh pr create -B beta -H dev --title 'Beta Release' --body 'Created by Github action' env: From 1d78f249c33c4bd80b107ac2b7cef458dbe79330 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 12:19:25 -0700 Subject: [PATCH 3/5] fix: show future cd workflow names --- .github/workflows/cd-beta.yaml | 15 ++++++--------- .github/workflows/cd-stable.yaml | 12 ++++++------ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cd-beta.yaml b/.github/workflows/cd-beta.yaml index b8744816a0..d21b7b37de 100644 --- a/.github/workflows/cd-beta.yaml +++ b/.github/workflows/cd-beta.yaml @@ -1,14 +1,11 @@ -# name: cd-beta +name: cd-beta -# on: -# # Uncomment to work on CD in development mode. -# # pull_request: -# # branches: [ master ] -# push: -# branches: -# - beta +on: + push: + branches: + - beta -# jobs: +jobs: # deploy_beta: # runs-on: ubuntu-latest # env: diff --git a/.github/workflows/cd-stable.yaml b/.github/workflows/cd-stable.yaml index 01ab125e87..b4abe2e85f 100644 --- a/.github/workflows/cd-stable.yaml +++ b/.github/workflows/cd-stable.yaml @@ -1,11 +1,11 @@ -# name: cd-stable +name: cd-stable -# on: -# push: -# branches: -# - stable +on: + push: + branches: + - stable -# jobs: +jobs: # deploy_stable: # runs-on: ubuntu-latest # env: From bbe679c186bf1b2465f548d3edbb2f46a6dbc2c4 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 12:31:28 -0700 Subject: [PATCH 4/5] dep: bump github action versions --- .github/workflows/cd-dev-stage.yaml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index 32d2a7044e..ce49589f21 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -25,11 +25,11 @@ jobs: - name: Checkout Repo uses: actions/checkout@v2 - name: Auth with Gcloud - uses: google-github-actions/auth@v0 + uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GCP_DEV_SA_KEY }} - name: Set up Gcloud SDK - uses: google-github-actions/setup-gcloud@v0 + uses: google-github-actions/setup-gcloud@v2 with: project_id: zesty-dev - name: Set up Node @@ -105,7 +105,7 @@ jobs: success_deploy_notification_to_slack: runs-on: ubuntu-latest if: ${{ success() }} - needs: [deploy_dev, deploy_stage] + needs: [deploy_stage] steps: - name: Success Deploy Notification To Slack uses: rtCamp/action-slack-notify@v2 @@ -128,11 +128,3 @@ jobs: run: gh pr create -B beta -H dev --title 'Beta Release' --body 'Created by Github action' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - uses: actions/checkout@v4 - # - name: Create Beta Release PR - # uses: peter-evans/create-pull-request@v6 - # with: - # branch: dev - # base: beta - # title: Beta Release - # # labels: From 2a2ec47ae73c61d046e8d3f9a80942e572dd5d67 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 12:42:28 -0700 Subject: [PATCH 5/5] turn on stable release pr creation --- .github/workflows/cd-beta.yaml | 157 ++++++++++++++++----------------- 1 file changed, 77 insertions(+), 80 deletions(-) diff --git a/.github/workflows/cd-beta.yaml b/.github/workflows/cd-beta.yaml index d21b7b37de..78957899f4 100644 --- a/.github/workflows/cd-beta.yaml +++ b/.github/workflows/cd-beta.yaml @@ -6,87 +6,84 @@ on: - beta jobs: -# deploy_beta: -# runs-on: ubuntu-latest -# env: -# ENV: "prod" + # deploy_beta: + # runs-on: ubuntu-latest + # env: + # ENV: "prod" -# steps: -# # This Clean step simply checks if there's already a workflow running from the last -# # commit and cancels it if there is. This helps us save on cloud cost in the long run. -# # See https://github.com/rokroskar/workflow-run-cleanup-action for more information. -# - name: Clean -# uses: rokroskar/workflow-run-cleanup-action@v0.2.2 -# env: -# GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" -# if: "github.ref != 'refs/heads/master'" -# - name: Checkout Repo -# uses: actions/checkout@v2 -# - name: Auth with Gcloud -# uses: google-github-actions/auth@v0 -# with: -# credentials_json: ${{ secrets.GCP_DEV_SA_KEY }} -# - name: Set up Gcloud SDK -# uses: google-github-actions/setup-gcloud@v0 -# with: -# project_id: zesty-prod -# - name: Set up Node -# uses: actions/setup-node@v2 -# with: -# node-version: "16.5.0" -# cache: "npm" -# cache-dependency-path: package-lock.json -# - name: Install Dependencies -# run: npm install -# - name: Build -# run: npm run build:prod -# env: -# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} -# - name: Deploy to Beta -# run: gcloud app deploy app.yaml --quiet --project --version beta zesty-prod + # steps: + # # This Clean step simply checks if there's already a workflow running from the last + # # commit and cancels it if there is. This helps us save on cloud cost in the long run. + # # See https://github.com/rokroskar/workflow-run-cleanup-action for more information. + # - name: Clean + # uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + # env: + # GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + # if: "github.ref != 'refs/heads/master'" + # - name: Checkout Repo + # uses: actions/checkout@v2 + # - name: Auth with Gcloud + # uses: google-github-actions/auth@v0 + # with: + # credentials_json: ${{ secrets.GCP_DEV_SA_KEY }} + # - name: Set up Gcloud SDK + # uses: google-github-actions/setup-gcloud@v0 + # with: + # project_id: zesty-prod + # - name: Set up Node + # uses: actions/setup-node@v2 + # with: + # node-version: "16.5.0" + # cache: "npm" + # cache-dependency-path: package-lock.json + # - name: Install Dependencies + # run: npm install + # - name: Build + # run: npm run build:prod + # env: + # SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + # - name: Deploy to Beta + # run: gcloud app deploy app.yaml --quiet --no-promote --version beta --project zesty-prod -# failed_deploy_notification_to_slack: -# runs-on: ubuntu-latest -# if: ${{ failure() }} -# needs: deploy_beta -# steps: -# - name: Failed Deploy Notification To Slack -# uses: rtCamp/action-slack-notify@v2 -# env: -# SLACK_CHANNEL: code-deploy -# SLACK_COLOR: "#FF0000" -# SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png -# SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." -# SLACK_TITLE: FAILED Beta Deployment for manager-ui -# SLACK_USERNAME: Deploy Bot -# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + # failed_deploy_notification_to_slack: + # runs-on: ubuntu-latest + # if: ${{ failure() }} + # needs: deploy_beta + # steps: + # - name: Failed Deploy Notification To Slack + # uses: rtCamp/action-slack-notify@v2 + # env: + # SLACK_CHANNEL: code-deploy + # SLACK_COLOR: "#FF0000" + # SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png + # SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." + # SLACK_TITLE: FAILED Beta Deployment for manager-ui + # SLACK_USERNAME: Deploy Bot + # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} -# success_deploy_notification_to_slack: -# runs-on: ubuntu-latest -# if: ${{ success() }} -# needs: [deploy_beta] -# steps: -# - name: Success Deploy Notification To Slack -# uses: rtCamp/action-slack-notify@v2 -# env: -# SLACK_CHANNEL: code-deploy -# SLACK_COLOR: "#FF0000" -# SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png -# SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." -# SLACK_TITLE: Beta Deployment for manager-ui -# SLACK_USERNAME: Deploy Bot -# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + # success_deploy_notification_to_slack: + # runs-on: ubuntu-latest + # if: ${{ success() }} + # needs: [deploy_beta] + # steps: + # - name: Success Deploy Notification To Slack + # uses: rtCamp/action-slack-notify@v2 + # env: + # SLACK_CHANNEL: code-deploy + # SLACK_COLOR: "#FF0000" + # SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png + # SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." + # SLACK_TITLE: Beta Deployment for manager-ui + # SLACK_USERNAME: Deploy Bot + # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} -# create_stable_pr: -# runs-on: ubuntu-latest -# needs: -# - deploy_beta - -# steps: -# - name: Create Stable Release PR -# uses: peter-evans/create-pull-request@v6 -# with: -# branch: master -# # base: master -# title: Stable Release -# # labels: + create_stable_pr: + runs-on: ubuntu-latest + # needs: [deploy_beta] + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + - name: Create Stable Release PR + run: gh pr create -B stable -H beta --title 'Stable Release' --body 'Created by Github action' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}