-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (43 loc) · 1.36 KB
/
deploy-on-release.yml
File metadata and controls
52 lines (43 loc) · 1.36 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
name: Deploy Website on Release
on:
push:
branches: [ main ]
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: '22'
- name: Install dependencies
run: npm ci
- name: Build site
run: cp sample.env .env && npm run b
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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 }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}