Skip to content

♻️ Refactor GitHub issues workflows #330

♻️ Refactor GitHub issues workflows

♻️ Refactor GitHub issues workflows #330

Workflow file for this run

---
name: Documentation
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
paths:
- .github/workflows/documentation.yml
- docs/**
- "!docs/archive/**"
push:
branches:
- main
paths:
- .github/workflows/documentation.yml
- docs/**
- "!docs/archive/**"
workflow_dispatch:
permissions: read-all
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: ministryofjustice/tech-docs-github-pages-publisher:ministryofjustice-fork
defaults:
run:
working-directory: docs
steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Compile Markdown to HTML
id: compile
run: /scripts/deploy.sh
- name: Upload artifact
id: upload_artifact
uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3.0.0
with:
name: github-pages
# This looks unusual, but it's correct
# `uses` (https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses) runs in the root of the repository
# so we need to specify the full path to the compiled documentation
path: docs/docs
deploy:
if: github.ref == 'refs/heads/main'
needs: [build]
name: Deploy
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.configure_github_pages.outputs.base_url }}
permissions:
pages: write
id-token: write
steps:
- name: Configure GitHub Pages
id: configure_github_pages
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0
- name: Deploy to GitHub Pages
id: deploy_github_pages
uses: actions/deploy-pages@87c3283f01cd6fe19a0ab93a23b2f6fcba5a8e42 # v4.0.3