publish-docs #57
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
--- | |
# 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@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.client_payload.tag }} | |
persist-credentials: true | |
- name: Checkout main | |
if: github.event.inputs.ref != '' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.ref }} | |
persist-credentials: true | |
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d | |
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 |