-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.39 KB
/
deploy-on-release.yml
File metadata and controls
55 lines (45 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Deploy Website on Release
on:
repository_dispatch:
types: [electerm-release]
push:
branches: [ master ]
workflow_dispatch:
jobs:
check-skip-ci:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.check.outputs.should_skip }}
steps:
- id: check
name: Check if [skip ci] is in commit message
run: |
if echo "${{ github.event.head_commit.message || '' }}" | grep -i '\[skip ci\]'; then
echo "should_skip=true" >> $GITHUB_OUTPUT
else
echo "should_skip=false" >> $GITHUB_OUTPUT
fi
build-and-deploy:
runs-on: ubuntu-latest
needs: check-skip-ci
if: needs.check-skip-ci.outputs.should_skip != 'true'
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm i
- name: Build site
run: npm run b
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Deploy to Vercel
run: |
npx vercel --prod --token "${{ secrets.VERCEL_TOKEN }}" --yes
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}