Skip to content

Commit c93e1fe

Browse files
committed
Add separate deploy workflow
1 parent 17b233c commit c93e1fe

File tree

2 files changed

+43
-18
lines changed

2 files changed

+43
-18
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
11
name: CI
22

33
on:
4-
push:
4+
pull_request:
55
branches:
6-
- '**'
6+
- main
77

88
jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/setup-node@v1
12+
- uses: actions/checkout@v2
13+
- uses: actions/cache@v2
1314
with:
14-
node-version: 12.x
15-
- uses: actions/checkout@v1
16-
- name: npm install, build, and test
17-
env:
18-
CI: true
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20-
run: |
21-
npm ci
22-
npm run build
23-
- name: vercel deploy
24-
if: ${{ github.ref == 'refs/heads/main' }}
25-
run: vercel --token ${{ secrets.VERCEL_TOKEN }} deploy --prod
26-
env:
27-
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
28-
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
15+
path: ~/.npm
16+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
17+
restore-keys: |
18+
${{ runner.os }}-node-
19+
- run: npm ci
20+
- name: build
21+
run: npm run build -- --locale en

.github/workflows/deploy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/cache@v2
14+
with:
15+
path: ~/.npm
16+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
17+
restore-keys: |
18+
${{ runner.os }}-node-
19+
- run: npm ci
20+
- name: build
21+
run: |
22+
npm run generate-markdown
23+
npm run crowdin:sync
24+
npm run build
25+
env:
26+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
- name: vercel deploy
29+
run: vercel --token ${{ secrets.VERCEL_TOKEN }} deploy --prod
30+
env:
31+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
32+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

0 commit comments

Comments
 (0)