-
Notifications
You must be signed in to change notification settings - Fork 511
67 lines (55 loc) · 2.06 KB
/
docusaurus-site.yml
File metadata and controls
67 lines (55 loc) · 2.06 KB
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
# This workflow builds and deploys the Docusaurus site.
#
# On pull requests, this workflow builds the site and deploys a temporary preview
# to gh-pages, but only if the relevant files have changed.
#
# On push to master or on workflow dispatch it deploys the site to:
# https://plutus.cardano.intersectmbo.org/docs
name: "🦕 Docusaurus Site"
on:
push:
branches:
- master
workflow_dispatch:
pull_request:
paths:
- 'doc/docusaurus/**'
- '.github/workflows/docusaurus-site.yml'
jobs:
run:
name: Run
runs-on: [self-hosted, plutus-runner]
permissions:
contents: write
pull-requests: write
environment:
name: github-pages
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Build Site
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
working-directory: doc/docusaurus
run: nix develop --no-warn-dirty --accept-flake-config --command bash -c 'yarn && yarn build'
- name: Deploy Site
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: JamesIves/github-pages-deploy-action@v4.7.6
with:
folder: doc/docusaurus/build
target-folder: docs
single-commit: true
- name: Build Preview Site
if: github.event_name == 'pull_request' && github.event.action != 'closed'
working-directory: doc/docusaurus
run: |
PR_NUMBER="${{ github.event.pull_request.number }}"
# These match the URL expected by rossjrw/pr-preview-action@v1.6.2:
export DOCUSAURUS_URL="https://plutus.cardano.intersectmbo.org"
export DOCUSAURUS_BASE_URL="/pr-preview/docs/pr-${PR_NUMBER}"
nix develop --no-warn-dirty --accept-flake-config --command bash -c 'yarn && yarn build'
- name: Deploy Preview Site
if: github.event_name == 'pull_request'
uses: rossjrw/pr-preview-action@v1.6.3
with:
source-dir: doc/docusaurus/build
umbrella-dir: pr-preview/docs