Skip to content

Commit

Permalink
Create publish-docs.yml
Browse files Browse the repository at this point in the history
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
signorecello authored Oct 25, 2023
1 parent 2c9fe26 commit 68bd6ff
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/publish-docs.yml
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

0 comments on commit 68bd6ff

Please sign in to comment.