mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-31 02:32:53 +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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- ci
|
|
||||||
- main
|
- main
|
||||||
- dev
|
- docs-snapshot
|
||||||
workflow_dispatch:
|
workflow_dispatch: {}
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- released
|
- released
|
||||||
- unpublished
|
|
||||||
- edited
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -22,17 +19,36 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get_latest_release:
|
snapshot-docs:
|
||||||
name: Get latest release
|
name: Snapshot documentation
|
||||||
uses: bdunderscore/modular-avatar/.github/workflows/get-latest-release.yml@main
|
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:
|
build-docs:
|
||||||
name: Build documentation (latest release)
|
name: Build documentation (latest release)
|
||||||
needs:
|
|
||||||
- get_latest_release
|
|
||||||
uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
|
uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
|
||||||
|
needs:
|
||||||
|
- snapshot-docs
|
||||||
with:
|
with:
|
||||||
ref: ${{ needs.get_latest_release.outputs.latest_release_tag }}
|
ref: docs-snapshot
|
||||||
|
|
||||||
build-docs-dev:
|
build-docs-dev:
|
||||||
name: Build documentation (main branch)
|
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