-
Notifications
You must be signed in to change notification settings - Fork 3
87 lines (67 loc) · 2.35 KB
/
publish-web.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
78
79
80
81
82
83
84
85
86
87
#
# https://quarto.org/docs/publishing/github-pages.html#publish-action
#
on:
workflow_dispatch:
#push:
# branches: main
name: Publish web docs
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
path: 'src'
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Checkout gh-pages in gh-pages folder
uses: actions/checkout@v4
with:
ref: 'gh-pages'
path: 'gh-pages'
- name: Enable matomo stats
run: |
# change the line var enabled=false to true.
sed -i 's/var enabled=false;/var enabled=true;/g' src/docs/js.html
- name: Backup files generated in other workflows
run: |
mkdir -p ./backup
# Backup the files generated by other workflows
cp ./gh-pages/index.yaml ./backup/
cp ./gh-pages/install-magasin.sh ./backup/
cp ./gh-pages/uninstall-magasin.sh ./backup/
cp -r ./gh-pages/mag-cli ./backup/
echo "------"
ls -la ./backup
- name: Render quarto in gh-pages
run: |
cd src
# output dir is relative to the root folder of quarto project (ie. docs/)
quarto render docs --output-dir ../../gh-pages/
cd ..
- name: Add the files managed by other GitHub actions
run: |
# Added by publish-helm-charts.yml
cp ./backup/index.yaml ./gh-pages/
# Added by publish installer
cp ./backup/install-magasin.sh ./gh-pages/
cp ./backup/uninstall-magasin.sh ./gh-pages/
# Added by publish-mag-cli-doc.yml
cp -r ./backup/mag-cli ./gh-pages/
- name: Add security.txt to gh-pages
run: |
# Create the ./well-known folder
mkdir -p ./gh-pages/.well-known
# copy security
cp -f src/docs/security.txt ./gh-pages/.well-known
- name: "Push the gh-pages folder to the gh-pages branch"
uses: EndBug/add-and-commit@v9
with:
cwd: './gh-pages/'
message: "Update main webiste"
committer_name: GitHub Actions
committer_email: [email protected]