Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta Release #2628

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
cc06e02
fix: split cd by environment
shrunyan Mar 19, 2024
9103360
improve slack alerts for cd
shrunyan Mar 19, 2024
26ab502
testing new branching strategy CD (#2598)
shrunyan Mar 19, 2024
3d26a5b
WIP: branching strategy
shrunyan Mar 19, 2024
868d7fe
Merge branch 'dev' of github.com:zesty-io/manager-ui into dev
shrunyan Mar 20, 2024
9a43ee5
bump node version
shrunyan Mar 20, 2024
102b690
revert: node version bump
shrunyan Mar 20, 2024
f9023b0
WIP: CD create beta release pr
shrunyan Mar 20, 2024
28854ef
fix: CD create beta release pr
shrunyan Mar 20, 2024
1d78f24
fix: show future cd workflow names
shrunyan Mar 20, 2024
bbe679c
dep: bump github action versions
shrunyan Mar 20, 2024
2a2ec47
turn on stable release pr creation
shrunyan Mar 20, 2024
1eba5bc
add: Darwins existing PR check
shrunyan Mar 20, 2024
a71a552
add: use zesty branding for automated slack notifications
shrunyan Mar 20, 2024
732c8bb
improve slack notice message
shrunyan Mar 20, 2024
d6f76e6
Test/branching strategy (#2601)
shrunyan Mar 20, 2024
14f08db
Convert media spaces in media filename to dashes (#2594)
finnar-bin Mar 20, 2024
a61a26d
Test/branching strategy (#2611)
shrunyan Mar 20, 2024
b00a280
fix the issue on showing published state on a selected version (#2590)
glespinosa Mar 21, 2024
3603fbc
task: add proper settings item route (#2613)
finnar-bin Mar 21, 2024
86e327b
split out stage workflow
shrunyan Mar 25, 2024
d87c313
fix: beta release cration during stage cd
shrunyan Mar 25, 2024
c959f6c
Merge branch 'master' into dev
shrunyan Mar 25, 2024
72b333c
fix: switch to concurrency groups and release-please in CD
shrunyan Mar 27, 2024
f37b1fb
fix: check current branch before release-please
shrunyan Mar 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/workflows/cd-beta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: cd-beta

on:
push:
branches:
- beta

jobs:
# 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 --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 }}

# 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: Checkout Repo
uses: actions/checkout@v2

- name: Check if PR exists
id: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
prs=$(gh pr list \
--repo "$GITHUB_REPOSITORY" \
--head 'beta' \
--base 'stable' \
--json title \
--jq 'length')
if ((prs > 0)); then
echo "skip=true" >> "$GITHUB_OUTPUT"
fi

- name: Create Stable Release
if: "!steps.check.outputs.skip"
run: gh pr create -B stable -H dev --title 'Stable Release' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121 changes: 121 additions & 0 deletions .github/workflows/cd-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: cd-dev

concurrency:
group: dev
cancel-in-progress: true

on:
# Uncomment to work on CD in development mode.
# pull_request:
# branches: [ master ]
push:
branches:
- dev

jobs:
deploy_dev:
runs-on: ubuntu-latest
env:
ENV: "dev"

steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Auth with Gcloud
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@v2
with:
project_id: zesty-dev
- 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:dev
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Deploy to Dev
run: gcloud app deploy app.yaml --quiet --project zesty-dev

failed_deploy_notification_to_slack:
runs-on: ubuntu-latest
if: ${{ failure() }}
needs: [deploy_dev]
steps:
- name: Failed Deploy Notification To Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: code-deploy
SLACK_COLOR: "#FF2A08"
SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg
SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy."
SLACK_TITLE: "FAILED: Dev 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_dev]
steps:
- name: Success Deploy Notification To Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: code-deploy
SLACK_COLOR: "#75BF43"
SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg
# SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage."
SLACK_TITLE: "SUCCESS: Dev Deployment of manager-ui"
SLACK_USERNAME: Deploy Bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

release-please:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- uses: google-github-actions/release-please-action@v4
with:
# this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
token: ${{ secrets.GITHUB_TOKEN }}
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: node
target-branch: stage

# create_stage_pr:
# runs-on: ubuntu-latest
# needs: [deploy_dev]
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v2

# - name: Check if PR exists
# id: check
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# prs=$(gh pr list \
# --repo "$GITHUB_REPOSITORY" \
# --head 'dev' \
# --base 'stage' \
# --json title \
# --jq 'length')
# if ((prs > 0)); then
# echo "skip=true" >> "$GITHUB_OUTPUT"
# fi

# - name: Create Stage Release
# if: "!steps.check.outputs.skip"
# run: gh pr create -B stage -H dev --title 'Stage Release' --body 'Created by Github action'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78 changes: 78 additions & 0 deletions .github/workflows/cd-stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: cd-stable

on:
push:
branches:
- stable

jobs:
# deploy_stable:
# 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 Stable
# run: gcloud app deploy app.yaml --quiet --project zesty-prod

# failed_deploy_notification_to_slack:
# runs-on: ubuntu-latest
# if: ${{ failure() }}
# needs: deploy_stable
# 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 Stable 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_stable]
# 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: Stable Deployment for manager-ui
# SLACK_USERNAME: Deploy Bot
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Loading
Loading