Deploy to GitHub Pages #6
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: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Hugo | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Checkout center app | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: PenumbraOS/center | |
| path: center-app | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v3 | |
| with: | |
| hugo-version: latest | |
| extended: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install center app dependencies | |
| run: npm ci | |
| working-directory: ./center-app | |
| - name: Build center and installer static artifacts | |
| run: npm run build:hugo-static | |
| working-directory: ./center-app | |
| - name: Stage generated app artifacts into Hugo static | |
| run: | | |
| rm -rf static/install static/center | |
| mkdir -p static/install static/center | |
| cp -R center-app/dist-hugo/install/. static/install/ | |
| cp -R center-app/dist-hugo/center/. static/center/ | |
| - name: Build site | |
| run: hugo --minify | |
| - name: Build search index for knowledgebase archive | |
| run: npx pagefind --site public --glob "archive/knowledgebase/**/*.html" | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./public | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |