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

81 lines
1.8 KiB
YAML

name: Deploy documentation
on:
push:
branches:
- ci
- main
- dev
workflow_dispatch:
release:
types:
- released
- unpublished
- edited
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
get_latest_release:
name: Get latest release
uses: bdunderscore/modular-avatar/.github/workflows/get-latest-release.yml@main
build-docs:
name: Build documentation (latest release)
needs:
- get_latest_release
uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
with:
ref: ${{ needs.get_latest_release.outputs.latest_release_tag }}
build-docs-dev:
name: Build documentation (main branch)
uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
with:
ref: main
path: dev
artifact: docs-dev
deploy-docs:
name: Deploy documentation
needs:
- build-docs
- build-docs-dev
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docs
path: docs/build
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docs-dev
path: docs/build/dev
- name: Dump file listing
run: |
ls -lR docs/build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs/build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2