GitHub Pages #35
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: GitHub Pages | |
| on: | |
| workflow_run: | |
| workflows: | |
| - Nightly Build | |
| types: | |
| - completed | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build Web Site | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') | |
| runs-on: ubuntu-22.04 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.ref }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| ref: ${{ github.event.workflow_run.head_sha || github.sha }} | |
| - name: Build Soluna (WASM) | |
| uses: ./.github/actions/soluna | |
| id: build | |
| with: | |
| soluna_path: "." | |
| - name: Install web build tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y lua5.4 zip | |
| - name: Prepare web assets | |
| run: | | |
| lua5.4 script/build_web.lua \ | |
| --soluna . \ | |
| --site web \ | |
| --wasm "${{ steps.build.outputs.SOLUNA_WASM_PATH }}" \ | |
| --js "${{ steps.build.outputs.SOLUNA_JS_PATH }}" | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v3 | |
| with: | |
| hugo-version: "0.154.5" | |
| - name: Build | |
| run: hugo --source web --minify | |
| - name: Upload static files as artifact | |
| id: deployment | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: web/public | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') | |
| needs: [build] | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |