-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
71 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Deploy Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- "v1" | ||
# - "v2" # Uncomment this line to deploy v2 | ||
paths-ignore: | ||
- '.gitignore' | ||
- 'LICENSE' | ||
- '*.md' | ||
- '*.adoc' | ||
- '*.txt' | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: pages | ||
cancel-in-progress: true | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
|
||
deploy: | ||
name: Deploy the documentation | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Prepare | ||
run: mkdir _site | ||
- name: Checkout v1 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: v1 | ||
path: _site/v1 | ||
## Uncomment this block to deploy v2 | ||
# - name: Checkout v2 | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# ref: v2 | ||
# path: _site/v2 | ||
- name: Clean | ||
run: rm -rf **/.git | ||
- name: Redirect to the latest version | ||
run: | | ||
export latest=$(ls -1 _site | sort -r | head -n 1) | ||
echo "<meta http-equiv='cache-control' content='no-cache, no-store, must-revalidate' />" > _site/index.html | ||
echo "<meta http-equiv='refresh' content='0;url=${latest}/index.html'>" >> _site/index.html | ||
- name: Upload Artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: _site/ | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
- name: Deploy to GitHub Pages | ||
uses: actions/deploy-pages@v4 | ||
id: deployment |
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 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