Add docs release workflow

This commit is contained in:
renehernandez 2022-03-17 11:02:38 -04:00
parent b1ccdfed77
commit c328d67926
4 changed files with 57 additions and 0 deletions

44
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Release Docs
on:
push:
branches:
- tags
paths:
- docs/**
-
jobs:
release_docs:
name: Release Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: python3 -m pip install -r ./docs/scripts/requirements.txt
- name: Build site
run: |
./docs/scripts/copy_docs.sh
mkdocs build
- name: Push site
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
destination_dir: ${{ env.GITHUB_REF_NAME }}
publish_dir: ./site
- name: Push redirect
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/redirect
keep_files: true]

7
docs/scripts/copy_docs.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -eo pipefail
cp CONTRIBUTING.md code-of-conduct.md ./docs/
cp LICENSE ./docs/LICENSE.md

View File

@ -0,0 +1,3 @@
<head>
<meta http-equiv="Refresh" content="0; url='/external-dns/{{.}}/'" />
</head>

View File

@ -0,0 +1,3 @@
mkdocs-git-revision-date-localized-plugin == 1.0.0
mkdocs == 1.2.3
mkdocs-material == 8.2.5