This repository was archived by the owner on Jan 22, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
71 lines (62 loc) · 1.79 KB
/
docs-publish.yml
File metadata and controls
71 lines (62 loc) · 1.79 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
67
68
69
70
71
name: Publish docs to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- main
paths:
- docs/**
- .github/workflows/docs_publish.yml
pull_request:
types:
- opened
- reopened
- synchronize
- closed
paths:
- docs/**
- .github/workflows/docs_publish.yml
permissions:
contents: write
pull-requests: write
jobs:
preview:
name: Preview docs
runs-on: ubuntu-24.04
if: (github.repository_owner == github.event.pull_request.head.repo.owner.login) && (github.event_name == 'pull_request')
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false
- name: Set base URL
run: |
yq -i '.baseUrl="contrast/pr-preview/pr-${{ github.event.number }}"' ./docs/docusaurus.config.js
- name: Build
working-directory: ./docs
run: |
npm i && npm run build
- name: Deploy Preview
uses: rossjrw/pr-preview-action@8ff09e486b4c23709012eedd3b42e9f0b95dd0c5 # v1.6.3
with:
source-dir: ./docs/build
publish:
name: Publish docs to GitHub Pages
runs-on: ubuntu-24.04
if: github.event_name == 'push' && github.ref_name == 'main'
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false
- name: Build
working-directory: ./docs
run: |
npm i && npm run build
- name: Publish
uses: JamesIves/github-pages-deploy-action@4a3abc783e1a24aeb44c16e869ad83caf6b4cc23 # v4.7.4
with:
folder: ./docs/build
branch: gh-pages
clean-exclude: pr-preview
force: false