Publish Documentation Site #346
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: Publish Documentation Site | |
| 'on': | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: {} | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build-site: | |
| name: Publish documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out doc site | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install mise-en-place | |
| uses: jdx/mise-action@v2 | |
| - name: "🌳 Fix local git branches" | |
| run: mise run ref-branches | |
| - name: Build site content | |
| run: mise run build | |
| - name: Upload site artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lenskit-site | |
| path: site | |
| publish-netlify: | |
| name: Upload to Netlify | |
| runs-on: ubuntu-latest | |
| needs: [build-site] | |
| environment: | |
| name: publish | |
| url: 'https://lkpy.lenskit.org' | |
| steps: | |
| - name: Fetch site artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: lenskit-site | |
| path: . | |
| - name: "🕸️ Deploy to Netlify" | |
| id: deployment | |
| uses: netlify/actions/cli@master | |
| with: | |
| args: deploy --dir=site --prod | |
| env: | |
| NETLIFY_AUTH_TOKEN: '${{secrets.NETLIFY_AUTH_TOKEN}}' | |
| NETLIFY_SITE_ID: '${{vars.NETLIFY_SITE_ID}}' | |
| publish-github: | |
| name: Upload to GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: [build-site] | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Fetch site artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: lenskit-site | |
| path: . | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| # Upload entire repository | |
| path: . | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |