Skip to content

meta: fix linter to include docs/ (#239) #157

meta: fix linter to include docs/ (#239)

meta: fix linter to include docs/ (#239) #157

Workflow file for this run

name: Deploy to GitHub Pages
on:
workflow_dispatch:
inputs:
UPPY_REF:
type: string
description: Uppy ref
required: false
workflow_call:
inputs:
UPPY_REF:
type: string
required: false
push:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
env:
NODE_VERSION: lts/*
permissions:
contents: write
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- if: ${{ !inputs.UPPY_REF }}
name: Extract Uppy version from yarn.lock
id: UPPY_VERSION_FROM_YARN_LOCK
run: |
grep 'resolution: "uppy@' yarn.lock | awk -F'"' '{ sub(/npm:/, ""); print "UPPY_REF=" $2 }' >> "$GITHUB_OUTPUT"
- name: Checkout docs from Uppy repo
uses: actions/checkout@v4
with:
repository: transloadit/uppy
ref:
${{ inputs.UPPY_REF ||
steps.UPPY_VERSION_FROM_YARN_LOCK.outputs.UPPY_REF }}
path: uppy
- run: mv uppy /tmp/uppy && ln -s /tmp/uppy/docs docs
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
env:
SKIP_YARN_COREPACK_CHECK: 1
- name: Install dependencies
run: corepack yarn install --immutable
- name: Build website
run: corepack yarn build
# Recommended action by Docusaurus:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./build