mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-30 18:22:52 +08:00
ci: cherry-pickable docs workflow (#479)
This commit is contained in:
parent
dd2f15d533
commit
65d5af509e
38
.github/workflows/deploy-pages.yml
vendored
38
.github/workflows/deploy-pages.yml
vendored
@ -2,15 +2,12 @@ name: Deploy documentation
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- ci
|
||||
- main
|
||||
- dev
|
||||
workflow_dispatch:
|
||||
- docs-snapshot
|
||||
workflow_dispatch: {}
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
- unpublished
|
||||
- edited
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@ -22,17 +19,36 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
get_latest_release:
|
||||
name: Get latest release
|
||||
uses: bdunderscore/modular-avatar/.github/workflows/get-latest-release.yml@main
|
||||
snapshot-docs:
|
||||
name: Snapshot documentation
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
# 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)
|
||||
needs:
|
||||
- get_latest_release
|
||||
uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
|
||||
needs:
|
||||
- snapshot-docs
|
||||
with:
|
||||
ref: ${{ needs.get_latest_release.outputs.latest_release_tag }}
|
||||
ref: docs-snapshot
|
||||
|
||||
build-docs-dev:
|
||||
name: Build documentation (main branch)
|
||||
|
23
.github/workflows/get-latest-release.yml
vendored
23
.github/workflows/get-latest-release.yml
vendored
@ -1,23 +0,0 @@
|
||||
# This is isolated to its own workflow file to avoid leaking publish secrets into the
|
||||
# github token
|
||||
name: Get latest release
|
||||
on:
|
||||
workflow_call:
|
||||
outputs:
|
||||
latest_release_tag:
|
||||
description: 'latest release tag'
|
||||
value: ${{ jobs.get_latest_release.outputs.latest_release_tag }}
|
||||
jobs:
|
||||
get_latest_release:
|
||||
name: Get latest release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: pozetroninc/github-action-get-latest-release@v0.7.0
|
||||
id: latest_release
|
||||
with:
|
||||
repository: bdunderscore/modular-avatar
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
excludes: "prerelease, draft"
|
||||
- run: echo "latest_release_tag=${{ steps.latest_release.outputs.release }}"
|
||||
outputs:
|
||||
latest_release_tag: ${{ steps.latest_release.outputs.release }}
|
Loading…
Reference in New Issue
Block a user