Skip to content

Commit

Permalink
fix: update cd approach
Browse files Browse the repository at this point in the history
  • Loading branch information
lmquang committed Feb 22, 2024
1 parent 6d96390 commit 2a48a57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 43 deletions.
29 changes: 6 additions & 23 deletions .github/workflows/deploy-mochi-web-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v3
- name: Merge to Preview
uses: devmasx/merge-branch@master
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run:
vercel pull --yes --environment=preview --token=${{
secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
- name: Set Vercel Deployment Alias
run:
vercel alias set websites-mochi-dwarves-consolelabs.vercel.app
beta.mochi.gg --token=${{ secrets.VERCEL_TOKEN }} --scope consolelabs
type: now
from_branch: mochi-web-preview
target_branch: mochi-web-preview-release
github_token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 6 additions & 20 deletions .github/workflows/deploy-mochi-web-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v3
- name: Merge to Prod
uses: devmasx/merge-branch@master
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Install Vercel CLI
run: pnpm add --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: |
vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} >deployment-url.txt 2>error.txt
deploymentUrl=`cat deployment-url.txt`
vercel alias $deploymentUrl mochi.gg --token=${{ secrets.VERCEL_TOKEN }} --scope consolelabs
type: now
from_branch: main
target_branch: mochi-web-prod
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 2a48a57

Please sign in to comment.