Skip to content

Commit bb8d80b

Browse files
author
niuweili
committed
feat: add staging
1 parent 5fc488c commit bb8d80b

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Staging Deployment
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
confirm_deploy:
7+
description: 'Type "yes" to confirm deployment'
8+
required: true
9+
default: 'no'
10+
11+
jobs:
12+
deploy-staging:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '18'
22+
23+
- name: Install dependencies
24+
run: yarn
25+
26+
- name: Export BUILD_MODE
27+
run: export BUILD_MODE=release
28+
29+
- name: Get version
30+
run: |
31+
FULL_VERSION=$(node -p -e "require('./lerna.json').version")
32+
MAJOR_VERSION=$(echo $FULL_VERSION | cut -d. -f1)
33+
echo "VERSION=$MAJOR_VERSION" >> $GITHUB_ENV
34+
echo "version=$MAJOR_VERSION" >> $GITHUB_OUTPUT
35+
env:
36+
BUILD_MODE: release
37+
38+
- name: Build bundle
39+
run: yarn build:bundle
40+
41+
- name: Deploy to staging
42+
run: node ./scripts/deploy/deploy-oss.js staging v${VERSION}
43+
env:
44+
OSS_ENDPOINT: ${{ secrets.OSS_ENDPOINT }}
45+
OSS_REGION: ${{ secrets.OSS_REGION }}
46+
OSS_ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
47+
OSS_BUCKET: ${{ secrets.OSS_BUCKET }}
48+
OSS_SECRET_KEY: ${{ secrets.OSS_SECRET_KEY }}

0 commit comments

Comments
 (0)