chore: avoid spoilers in main documentation pages

This commit is contained in:
bd_ 2023-07-30 12:28:18 +09:00
parent c10a2de7de
commit c0c5848548
3 changed files with 43 additions and 12 deletions

View File

@ -16,6 +16,10 @@ on:
description: 'artifact name to write' description: 'artifact name to write'
type: string type: string
required: false required: false
latest:
description: 'build the latest release'
type: boolean
required: false
jobs: jobs:
build-docs: build-docs:
@ -25,12 +29,10 @@ jobs:
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 18
- uses: actions/checkout@v3 # check out this repo
if: ${{ !inputs.ref }} - uses: actions/checkout@v3
- uses: actions/checkout@v3 # check out the repo we're building docs for
if: ${{ inputs.ref }}
with: with:
ref: ${{ inputs.ref }} ref: ${{ inputs.ref || github.ref }}
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
repository: bdunderscore/modular-avatar-images repository: bdunderscore/modular-avatar-images

View File

@ -17,17 +17,23 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
get_latest_release:
name: Get latest release
uses: bdunderscore/modular-avatar/.github/workflows/get-latest-release.yml@main
build-docs: build-docs:
name: Build documentation 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 uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
with: with:
ref: main ref: main
build-docs-dev:
name: Build documentation (dev branch)
uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
with:
ref: dev
path: dev path: dev
artifact: docs-dev artifact: docs-dev
deploy-docs: deploy-docs:

View File

@ -0,0 +1,23 @@
# 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 }}