get changed investigations #25
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: marp-to-pages | |
concurrency: marp-to-pages | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
pages: write | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Ensure build dir exists | |
run: mkdir -p build | |
- name: Copy images directory (if exists) | |
run: if [[ -d mission_statement/images ]]; then cp -R mission_statement/images build/images; fi | |
- name: Download moj theme | |
run: wget https://raw.githubusercontent.com/ministryofjustice/marp-moj-theme/main/themes/moj.css | |
- name: Marp Build (Mission statement) | |
run: | | |
npx @marp-team/marp-cli@latest mission_statement/README.md \ | |
-o build/index.html --theme moj.css --html | |
- name: Create directories (Investigations) | |
run: | | |
for directory in investigations/*/ ; do | |
mkdir -p build/$(basename $directory) | |
done | |
- name: Copy Images directory (Investigations) | |
run: | | |
for directory in investigations/*/ ; do | |
if [[ -d $directory/images ]]; | |
then | |
cp -R $directory/images build/$(basename $directory)/images; | |
echo "copied $directory/images" | |
fi | |
done | |
- name: Marp Build (Investigations) | |
run: | | |
for directory in investigations/*/ ; do | |
npx @marp-team/marp-cli@latest $directory/README.md \ | |
-o build/$(basename $directory)/index.html --theme moj.css --html | |
done | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'build/' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |