Skip to content

Commit 18d2bf4

Browse files
committed
workaround 404s
1 parent 1358862 commit 18d2bf4

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/DeployDocs.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Taken from the Lux.jl deployment strategy
2+
# This helps us avoid Vitepress hydration issues when viewing a webpage from a symlink
3+
name: Deploy GitHub Pages
4+
5+
on:
6+
# Runs on pushes targeting the default branch
7+
push:
8+
branches:
9+
- gh-pages
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22+
concurrency:
23+
group: "pages"
24+
cancel-in-progress: false
25+
26+
jobs:
27+
# Build job
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
ref: "gh-pages"
35+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
36+
- name: Setup Pages
37+
uses: actions/configure-pages@v5
38+
- name: Fix Symlinks for Vitepress
39+
run: |
40+
find -type l -exec bash -c 'dir="$0"; newlnk=${dir:2}; lnk="$(readlink -m "$0")"; orglnk=$(basename $lnk); echo "$newlnk <--> $orglnk"; rm "$0"; cp -r $lnk "$0"; cd "$0"; grep "$orglnk" . -lr | xargs sed -i "s/$orglnk/$newlnk/g"; cd ..' {} \;
41+
ls -al;
42+
- name: Build with Jekyll
43+
uses: actions/jekyll-build-pages@v1
44+
with:
45+
source: ./
46+
destination: ./_site
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v3
49+
50+
# Deployment job
51+
deploy:
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
runs-on: ubuntu-latest
56+
needs: build
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)