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

chore(release): adjust gcp deployment workflow to new tag format #687

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 25 additions & 3 deletions .github/workflows/deploy-api-to-akash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to deploy'
description: "Tag to deploy"
required: true
type: string
workflow_call:
inputs:
tag:
description: "Tag to deploy"
required: true
type: string

Expand Down Expand Up @@ -57,10 +63,10 @@ jobs:
app="api-${prerelease_type:-prod}"
version="${tag#console-api/v}"
image="${{ vars.API_REGISTRY }}:$version"

echo "app=${app}"
echo "image=${image}"

echo "app=${app}" >> $GITHUB_OUTPUT
echo "image=${image}" >> $GITHUB_OUTPUT

Expand Down Expand Up @@ -88,6 +94,14 @@ jobs:
seed: ${{ secrets.WALLET_MNEMONIC }}
password: ${{ secrets.WALLET_PASSWORD }}

- name: Post Deploy Summary
if: success()
run: |
echo "## Sandbox Deployment Summary" >> $GITHUB_STEP_SUMMARY
echo "✅ Successfully deployed version ${{ github.event.inputs.tag }}" >> $GITHUB_STEP_SUMMARY
echo "- Environment: Sandbox" >> $GITHUB_STEP_SUMMARY
echo "- Image: ${{ needs.define-vars.outputs.image }}" >> $GITHUB_STEP_SUMMARY

deploy-mainnet:
name: Deploy Mainnet
needs: [define-vars, deploy-sandbox]
Expand All @@ -109,3 +123,11 @@ jobs:
image: ${{ needs.define-vars.outputs.image }}
password: ${{ secrets.WALLET_PASSWORD }}
seed: ${{ secrets.WALLET_MNEMONIC }}

- name: Post Deploy Summary
if: success()
run: |
echo "## Mainnet Deployment Summary" >> $GITHUB_STEP_SUMMARY
echo "✅ Successfully deployed version ${{ github.event.inputs.tag }}" >> $GITHUB_STEP_SUMMARY
echo "- Environment: Mainnet" >> $GITHUB_STEP_SUMMARY
echo "- Image: ${{ needs.define-vars.outputs.image }}" >> $GITHUB_STEP_SUMMARY
38 changes: 28 additions & 10 deletions .github/workflows/deploy-web-to-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,54 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to deploy'
description: "Tag to deploy"
required: true
type: string
workflow_call:
inputs:
tag:
description: "Tag to deploy"
required: true
type: string

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}

jobs:
deploy:
name: Deploy to GCP
runs-on: ubuntu-latest
environment: ${{ contains(github.event.inputs.tag, '-beta') && 'beta' || 'production' }}

steps:
- name: Define variables
id: vars
run: |
tag="${{ github.event.inputs.tag }}"
if [[ ! "$tag" =~ ^console-web/v[0-9]+\.[0-9]+\.[0-9]+(-beta\.[0-9]+)?$ ]]; then
echo "Invalid tag. Expected console-web/v* or console-web/v*-beta.*"

if [[ ! "$tag" =~ ^console-web/v[0-9]+\.[0-9]+\.[0-9]+(-beta)?$ ]]; then
echo "::error::Invalid tag format. Expected console-web/v* or console-web/v*-beta (e.g., console-web/v1.2.3 or console-web/v1.2.3-beta)"
exit 1
fi

version="${tag#*/v}"

instance_name=""
if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+$ ]]; then

if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+-beta$ ]]; then
instance_name="${{ vars.BETA_WEB_INSTANCE_NAME }}"
elif [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
instance_name="${{ vars.PROD_WEB_INSTANCE_NAME }}"
fi

image="${{ vars.WEB_REGISTRY }}:$version"

echo "instance-name=${instance_name}"
echo "image=${image}"

echo "instance-name=${instance_name}" >> "$GITHUB_OUTPUT"
echo "image=${image}" >> "$GITHUB_OUTPUT"

Expand All @@ -57,3 +67,11 @@ jobs:
image: ${{ steps.vars.outputs.image }}
credentials_json: ${{ secrets.GCP_SA_KEY }}
zone: ${{ vars.GCP_ZONE }}

- name: Post Deploy Summary
if: success()
run: |
echo "## Deployment Summary" >> $GITHUB_STEP_SUMMARY
echo "✅ Successfully deployed version ${{ github.event.inputs.tag }}" >> $GITHUB_STEP_SUMMARY
echo "- Instance: ${{ steps.vars.outputs.instance-name }}" >> $GITHUB_STEP_SUMMARY
echo "- Image: ${{ steps.vars.outputs.image }}" >> $GITHUB_STEP_SUMMARY
4 changes: 2 additions & 2 deletions .github/workflows/release-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
paths:
- 'apps/api/package.json'
- "apps/api/package.json"

jobs:
release:
Expand All @@ -24,4 +24,4 @@ jobs:
contents: write
packages: write
with:
tag: ${{ needs.release.outputs.version }}
tag: ${{ needs.release.outputs.version }}
4 changes: 2 additions & 2 deletions .github/workflows/release-deploy-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
paths:
- 'apps/deploy-web/package.json'
- "apps/deploy-web/package.json"

jobs:
release:
Expand Down Expand Up @@ -37,4 +37,4 @@ jobs:
packages: write
with:
tag: ${{ needs.release.outputs.version }}
deployment-env: production
deployment-env: production
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class TopUpCustodialDeploymentsService implements DeploymentsRefiller {
summary.inc("deploymentTopUpCount");
summary.ensurePredictedClosedHeight(predictedClosedHeight);

this.logger.info({ event: "TOP_UP_DEPLOYMENT_SUCCESS", ...logParams });
this.logger.info({ event: "TOP_UP_SUCCESS", ...logParams });
} catch (error) {
this.logger.error({ event: "TOP_UP_DEPLOYMENT_ERROR", message: error.message, stack: error.stack, ...logParams });
summary.inc("deploymentTopUpErrorCount");
Expand Down
Loading