Skip to content

get changed investigations #23

get changed investigations

get changed investigations #23

Workflow file for this run

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: Get changed investigations
# id: changed-investigations
# uses: tj-actions/changed-files@v44
# with:
# files: investigations/*/*.md
# dir_names: 'true'
- name: Copy Images directory (Investigations)
run: |
for directory in investigations/ ; do
if [[ -d $directory/images ]];
then
cp -R $directory/images build/images;
echo "copied "
fi
done
- name: Marp Build (Investigations)
run: |
for directory in investigations/ ; do
npx @marp-team/marp-cli@latest $directory/README.md \
-o build/$directory.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