-
Notifications
You must be signed in to change notification settings - Fork 15
57 lines (44 loc) · 1.36 KB
/
deploy.yml
File metadata and controls
57 lines (44 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
53
54
55
56
57
name: Deploy to GitHub Pages
on:
push:
branches:
- source
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Create en translation
run: npm run write-translations -- --locale en
- name: Build website
run: npm run build
- name: Compress build output
run: tar -czf build.tar.gz -C build .
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
user_name: hezhuozhuo
user_email: 421045249@qq.com
- name: Install GitHub CLI
run: |
sudo apt update
sudo apt install -y gh
- name: Delete existing latest release (if exists)
run: |
gh release delete latest --yes || echo "No existing latest release"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create new latest release
run: |
gh release create latest build.tar.gz --title "Latest Release" --notes "Auto-generated release from GitHub Actions"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}