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