Skip to content

Publish web docs

Publish web docs #53

Workflow file for this run

#
# 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
- 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' 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: |
# 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 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 and mag-cli docs"
committer_name: GitHub Actions
committer_email: [email protected]