modular-avatar/.github/workflows/deploy-pages.yml
dependabot[bot] b8f786dc4b
chore(deps): bump actions/checkout from 2 to 4 in /.github/workflows (#487)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-09 15:48:25 +09:00

103 lines
2.5 KiB
YAML

name: Deploy documentation
on:
push:
branches:
- main
- docs-snapshot
workflow_dispatch: {}
release:
types:
- released
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
snapshot-docs:
name: Snapshot documentation
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
# Run on releases only
if: ${{ github.event.release }}
with:
ref: ${{ github.ref }}
fetch-depth: 0
fetch-tags: true
- name: Merge with existing branch
# Run on releases only
if: ${{ github.event.release }}
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "github-actions@nadena.dev"
git merge -s ours origin/docs-snapshot
git push origin HEAD:docs-snapshot
build-docs:
name: Build documentation (latest release)
uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
needs:
- snapshot-docs
with:
ref: docs-snapshot
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: Unpack documentation
run: |
tar -xf docs/build/docs.tar -C docs/build
tar -xf docs/build/dev/docs.tar -C docs/build/dev
rm -f docs/build/docs.tar docs/build/dev/docs.tar
- 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