2022-09-10 08:18:35 +08:00
|
|
|
name: Deploy documentation
|
2022-09-08 11:46:13 +08:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2023-03-25 13:22:48 +08:00
|
|
|
- ci
|
2022-09-09 11:37:40 +08:00
|
|
|
- main
|
2023-03-25 13:22:48 +08:00
|
|
|
- dev
|
2022-09-09 11:37:40 +08:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: "pages"
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-09-08 11:46:13 +08:00
|
|
|
jobs:
|
2023-07-30 11:28:18 +08:00
|
|
|
get_latest_release:
|
|
|
|
name: Get latest release
|
|
|
|
uses: bdunderscore/modular-avatar/.github/workflows/get-latest-release.yml@main
|
|
|
|
|
2022-09-09 12:01:14 +08:00
|
|
|
build-docs:
|
2023-07-30 11:28:18 +08:00
|
|
|
name: Build documentation (latest release)
|
|
|
|
needs:
|
|
|
|
- get_latest_release
|
2023-03-25 13:54:29 +08:00
|
|
|
uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
|
2023-05-05 12:50:45 +08:00
|
|
|
with:
|
2023-07-30 11:28:18 +08:00
|
|
|
ref: ${{ needs.get_latest_release.outputs.latest_release_tag }}
|
2023-05-05 12:50:45 +08:00
|
|
|
|
2023-03-25 13:22:48 +08:00
|
|
|
build-docs-dev:
|
2023-07-30 11:28:18 +08:00
|
|
|
name: Build documentation (main branch)
|
2023-03-25 13:54:29 +08:00
|
|
|
uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
|
2023-03-25 13:22:48 +08:00
|
|
|
with:
|
2023-07-30 11:28:18 +08:00
|
|
|
ref: main
|
2023-03-25 13:22:48 +08:00
|
|
|
path: dev
|
|
|
|
artifact: docs-dev
|
2022-09-10 08:18:35 +08:00
|
|
|
deploy-docs:
|
2022-09-10 08:57:52 +08:00
|
|
|
name: Deploy documentation
|
2023-03-25 13:22:48 +08:00
|
|
|
needs:
|
|
|
|
- build-docs
|
|
|
|
- build-docs-dev
|
2022-09-08 11:46:13 +08:00
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
runs-on: ubuntu-latest
|
2022-09-10 08:18:35 +08:00
|
|
|
|
2022-09-08 11:46:13 +08:00
|
|
|
steps:
|
2022-09-10 08:18:35 +08:00
|
|
|
- name: Download artifact
|
2023-03-25 13:48:42 +08:00
|
|
|
uses: actions/download-artifact@v3
|
2022-09-08 11:46:13 +08:00
|
|
|
with:
|
2022-09-10 08:18:35 +08:00
|
|
|
name: docs
|
|
|
|
path: docs/build
|
2023-03-25 13:22:48 +08:00
|
|
|
- name: Download artifact
|
2023-03-25 13:48:42 +08:00
|
|
|
uses: actions/download-artifact@v3
|
2023-03-25 13:22:48 +08:00
|
|
|
with:
|
|
|
|
name: docs-dev
|
|
|
|
path: docs/build/dev
|
2023-03-25 13:57:38 +08:00
|
|
|
|
|
|
|
- name: Dump file listing
|
2023-03-25 13:22:48 +08:00
|
|
|
run: |
|
|
|
|
ls -lR docs/build
|
2022-09-08 11:46:13 +08:00
|
|
|
|
|
|
|
- name: Setup Pages
|
2023-03-27 22:34:14 +08:00
|
|
|
uses: actions/configure-pages@v3
|
2022-09-08 11:46:13 +08:00
|
|
|
|
|
|
|
- name: Upload artifact
|
2023-07-17 13:52:14 +08:00
|
|
|
uses: actions/upload-pages-artifact@v2
|
2022-09-08 11:46:13 +08:00
|
|
|
with:
|
2022-09-09 11:37:40 +08:00
|
|
|
path: docs/build
|
2022-09-08 11:46:13 +08:00
|
|
|
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
2023-05-05 12:50:45 +08:00
|
|
|
uses: actions/deploy-pages@v2
|