-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (37 loc) · 1.13 KB
/
static.yml
File metadata and controls
47 lines (37 loc) · 1.13 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
name: Deploy to GitHub Pages
on:
push:
branches: [main]
permissions:
contents: write
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: cd htmltoolkit && npm ci
- name: Build the site
run: |
cd htmltoolkit
npm run build
- name: Rename 200.html to 404.html for GitHub Pages SPA fallback
run: |
if [ -f htmltoolkit/build/200.html ]; then
mv htmltoolkit/build/200.html htmltoolkit/build/404.html
fi
touch htmltoolkit/build/.nojekyll
- name: Generate sitemap
run: cd htmltoolkit && npx svelte-sitemap --domain https://htmltoolkit.github.io/
- name: Fix root URL in sitemap
run: sed -i 's|/index|/|g' htmltoolkit/build/sitemap.xml
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: htmltoolkit/build