-
Notifications
You must be signed in to change notification settings - Fork 27
66 lines (60 loc) · 1.86 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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