-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (46 loc) · 1.4 KB
/
deploy.yml
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
name: Deploy site to gh-pages
on:
push:
branches: [ main ]
jobs:
deploy:
name: Deploy updates
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Clean install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Check version
id: version-check
uses: Endbug/version-check@v2
with:
diff-search: true
- name: Commit user style changes
if: steps.version-check.outputs.changed == 'true'
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git add public/*.user.css
git commit -m "Publish updates v${{ steps.version-check.outputs.version }}"
git tag v${{ steps.version-check.outputs.version }}
- name: Publish user style changes
if: steps.version-check.outputs.changed == 'true'
uses: ad-m/github-push-action@v0.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: Deploy site
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
destination_dir: docs