fix(ci): grant callers the permissions their reusable workflows decla… #32
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
| # This workflow is managed by gh actions-lock. | |
| # SPDX-License-Identifier: MPL-2.0 | |
| # This workflow is managed by gh actions-lock. | |
| # This workflow is managed by gh actions-lock. | |
| name: GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| 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 | |
| uses: actions/checkout@v4.1.1 | |
| - name: Checkout casket-ssg | |
| uses: actions/checkout@v4.1.1 | |
| with: | |
| repository: hyperpolymath/casket-ssg | |
| path: .casket-ssg | |
| - name: Setup GHCup | |
| uses: haskell-actions/setup@v2.7.5 | |
| with: | |
| ghc-version: '9.8.2' | |
| cabal-version: '3.10' | |
| - name: Cache Cabal | |
| uses: actions/cache@v4.3.0 | |
| with: | |
| path: | | |
| ~/.cabal/packages | |
| ~/.cabal/store | |
| .casket-ssg/dist-newstyle | |
| key: ${{ runner.os }}-casket-${{ hashFiles('.casket-ssg/casket-ssg.cabal') }} | |
| - name: Build casket-ssg | |
| working-directory: .casket-ssg | |
| run: cabal build | |
| - name: Build site | |
| run: | | |
| mkdir -p site _site | |
| # Generate the landing page from the available project introduction. | |
| if [ ! -f site/index.md ]; then | |
| { | |
| echo "---" | |
| echo "title: $(basename "$PWD")" | |
| echo "date: $(date +%Y-%m-%d)" | |
| echo "---" | |
| if [ -f README.adoc ]; then | |
| cat README.adoc | |
| elif [ -f README.md ]; then | |
| cat README.md | |
| else | |
| echo "# $(basename "$PWD")" | |
| echo "Documentation coming soon." | |
| fi | |
| } > site/index.md | |
| fi | |
| cd .casket-ssg && cabal run casket-ssg -- build ../site ../_site | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5.0.0 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3.0.1 | |
| with: | |
| path: '_site' | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4.0.5 |