Deploy to GitHub Pages #146
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to GitHub Pages | |
| on: | |
| workflow_run: | |
| workflows: ["Submodules Sync"] | |
| types: | |
| - completed | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Find and Copy Latest 404.html | |
| run: | | |
| set -e | |
| folders=$(find . -maxdepth 1 -type d | sort -r) | |
| echo "Folders: $folders" | |
| latest_file="" | |
| for dir in $folders; do | |
| if [ -f "$dir/404.html" ]; then | |
| latest_file="$dir/404.html" | |
| echo "Found 404.html in $dir" | |
| break | |
| fi | |
| done | |
| if [ -n "$latest_file" ]; then | |
| echo "Copying $latest_file to root as 404.html" | |
| cp "$latest_file" ./404.html | |
| else | |
| echo "No 404.html found in submodule folders." | |
| fi | |
| - name: Configure Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: "." | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |