-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (61 loc) · 2.04 KB
/
gh-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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