-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I can't trigger a new workflow if it's not already on master, so I don't even know if this will work. But I can then iterate on it from my test branch
- Loading branch information
1 parent
2c9fe26
commit 68bd6ff
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Publish Docs | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: The tag to build Docs for | ||
required: false | ||
|
||
jobs: | ||
publish-docs: | ||
runs-on: ubuntu-latest | ||
if: ${{ inputs.tag != '' }} | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.tag }} | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Cut a new version | ||
run: cd docs && yarn docusaurus docs:version ${{ inputs.tag }} | ||
|
||
- name: Build docs | ||
run: yarn workspace docs build | ||
|
||
- name: Deploy to Netlify | ||
uses: nwtgck/[email protected] | ||
with: | ||
publish-dir: './docs/build' | ||
production-branch: master | ||
production-deploy: false # TODO change to true | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
enable-github-deployment: false | ||
deploy-message: "Deploy from GitHub Actions for tag ${{ inputs.tag }}" | ||
env: | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | ||
timeout-minutes: 1 |