Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): release docs as alpha when doing a pre-release #1624

Merged
merged 4 commits into from
Oct 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/on_release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ on:
default: false
type: boolean
required: false
pre_release:
description: "Publishes documentation using a pre-release tag. You are still responsible for passing a pre-release version tag to the workflow."
default: false
type: boolean
required: false

jobs:
release:
Expand Down Expand Up @@ -113,15 +118,30 @@ jobs:
contents: write
uses: ./.github/workflows/reusable_publish_changelog.yml

# When doing a pre-release, we want to publish the docs as "alpha" instead of replacing the latest docs
prepare_docs_alias:
runs-on: ubuntu-latest
outputs:
DOCS_ALIAS: ${{ steps.set-alias.outputs.DOCS_ALIAS }}
steps:
- name: Set docs alias
id: set-alias
run: |
DOCS_ALIAS=latest
if [[ "${{ github.event.release.prerelease || inputs.pre_release }}" == true ]] ; then
DOCS_ALIAS=alpha
fi
echo DOCS_ALIAS="$DOCS_ALIAS" >> "$GITHUB_OUTPUT"

docs:
needs: [release, changelog]
needs: [release, changelog, prepare_docs_alias]
permissions:
contents: write
pages: write
uses: ./.github/workflows/reusable_publish_docs.yml
with:
version: ${{ needs.release.outputs.RELEASE_VERSION }}
alias: latest
alias: ${{ needs.prepare_docs_alias.outputs.DOCS_ALIAS }}
detached_mode: true

publish_layer:
Expand Down