Merge pull request #1304 from flux-iac/print-plan #161
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
name: docs | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'docs/**' | |
- '.github/workflows/docs.yaml' | |
- 'mkdocs.yml' | |
permissions: | |
contents: read # for actions/checkout to fetch code | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.0.0 | |
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | |
with: | |
python-version: 3.x | |
- name: Install mkdocs | |
run: pip install mkdocs-material | |
- name: Generate docs artifacts | |
run: mkdocs build -d /tmp/docs | |
- uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.0.0 | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Publish docs artifacts to gh-pages | |
run: | | |
cd gh-pages | |
shopt -s extglob | |
rm -rf !(index.yaml|LICENSE|*.tgz) | |
cp -R /tmp/docs/** . | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit -m "Publish docs from $GITHUB_SHA" | |
git push https://github.com/$GITHUB_REPOSITORY.git gh-pages |