Skip to content

Publish documentation #40

Publish documentation

Publish documentation #40

Workflow file for this run

---
# This is a manually triggered workflow to build and publish the MkDocs from the
# specified Git revision to GitHub pages on https://aquasecurity.github.io/trivy-operator.
name: Publish documentation
on:
repository_dispatch:
types: [publish-docs]
workflow_dispatch:
inputs:
ref:
description: The branch, tag or SHA to deploy, e.g. v0.0.1
required: true
# Disable permissions granted to the GITHUB_TOKEN for all the available scopes.
permissions: {}
jobs:
deploy:
name: Deploy documentation
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout main
if: github.event.inputs.ref == ''
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
with:
fetch-depth: 0
ref: ${{ github.event.client_payload.tag }}
persist-credentials: true
- name: Checkout main
if: github.event.inputs.ref != ''
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
with:
fetch-depth: 0
ref: ${{ github.event.inputs.ref }}
persist-credentials: true
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: 3.x
- run: |
pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
pip install mike
pip install mkdocs-macros-plugin
env:
# Note: It is not the same as ${{ secrets.GITHUB_TOKEN }} !
GH_TOKEN: ${{ secrets.MKDOCS_AQUA_BOT }}
- run: |
git config user.name "aqua-bot"
git config user.email "[email protected]"
- name: Checkout main input
if: github.event.inputs.ref != ''
run: |
mike deploy --push --update-aliases ${{ github.event.inputs.ref }} latest
- name: Checkout main release
if: github.event.inputs.ref == ''
run: |
mike deploy --push --update-aliases ${{ github.event.client_payload.tag }} latest