Publish web docs #61
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
# | |
# 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] |