modular-avatar/.github/workflows/deploy-pages.yml

76 lines
1.7 KiB
YAML
Raw Normal View History

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:
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:
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
with:
ref: ${{ needs.get_latest_release.outputs.latest_release_tag }}
2023-03-25 13:22:48 +08:00
build-docs-dev:
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:
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
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
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
uses: actions/configure-pages@v3
2022-09-08 11:46:13 +08:00
- name: Upload artifact
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
uses: actions/deploy-pages@v2