Publish gh-pages #325
This file contains 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 gh-pages | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "main" | |
paths-ignore: | |
- "docs/**" | |
# GITHUB_TOKEN permissions to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:35699473dbeefeeb8b597de024125a241277ee03587d5fe8e72545e4b27b33f8 # v5.0.0 | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Build | |
id: build | |
run: | | |
/usr/local/bin/package | |
- name: Upload Artifact | |
id: upload_artifact | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: github-pages | |
path: artifact.tar | |
retention-days: 1 | |
overwrite: true | |
publish: | |
needs: build | |
name: Publish | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.configure_pages.outputs.base_url }} | |
permissions: | |
contents: read | |
id-token: write | |
pages: write | |
steps: | |
- name: Configure Pages | |
id: configure_pages | |
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 | |
- name: Deploy to GitHub Pages | |
id: deploy_pages | |
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 | |
linkChecker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Link Checker | |
uses: lycheeverse/[email protected] | |
with: | |
fail: true | |
args: --verbose --exclude-mail --no-progress './**/*.md' './**/*.html' './**/*.erb' --accept 403,200,429 |