-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (55 loc) · 1.65 KB
/
Copy pathdeploy.yml
File metadata and controls
67 lines (55 loc) · 1.65 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
58
59
60
61
62
63
64
65
66
67
name: Auto Update README & Deploy Web
on:
push:
branches:
- main
paths:
- 'games.list'
- 'template.html'
- 'scripts/web.sh'
- 'scripts/readme.sh'
- 'Makefile'
schedule:
- cron: '0 0 * * 0' # automatic run at 00:00 every Sunday
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Grant execute permission for scripts
run: |
chmod +x scripts/web.sh
chmod +x scripts/readme.sh
- name: Make readme
run: make readme
- name: Commit and Push README to main
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add README.md
if ! git diff-index --quiet HEAD; then
git commit -m "docs: auto-update README.md [skip ci]"
git push origin main
echo "=> Automatic commit and push README.md to main."
else
echo "=> README.md no changes, skip commiting."
fi
- name: Build static HTML
run: make web
- name: Create Deploy directory
run: |
mkdir -p deploy_dist
mv index.html deploy_dist/
- name: Deploying Website to gh-pages branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./deploy_dist
publish_branch: gh-pages
force_orphan: true