-
Notifications
You must be signed in to change notification settings - Fork 16
55 lines (55 loc) · 1.94 KB
/
Preview.yml
File metadata and controls
55 lines (55 loc) · 1.94 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
name: Preview
on:
pull_request:
pull_request_target:
types: [labeled]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
if: ( github.event.pull_request.head.repo.fork == false ) || ( github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ok to preview') )
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install Julia
uses: julia-actions/setup-julia@v2
with:
version: '1'
- name: Fix prepath
run: sed -i 's/# prepath = "preview\/PR"/prepath = "preview\/PR${{ github.event.number }}"/' docs/config.md
- name: Build
run: julia --project=docs -e '
cd("docs");
using Pkg; Pkg.activate("."); Pkg.instantiate();
using NodeJS;
run(`$(npm_cmd()) install lunr`);
run(`$(npm_cmd()) install cheerio`);
run(`$(npm_cmd()) install highlight.js`);
using Franklin;
serve(single=true, cleanup=false);
lunr();
optimize()'
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
ssh-key: ${{ secrets.PREVIEW }}
branch: gh-pages
folder: docs/__site
target-folder: PR${{ github.event.number }}
repository-name: JuliaPackageComparisons/preview
- name: Create comment
uses: peter-evans/create-or-update-comment@v5
with:
issue-number: ${{ github.event.number }}
body: |
Document generation succeeded!
Preview site will be available at https://juliapackagecomparisons.github.io/preview/PR${{ github.event.number }} after github-pages deployment🚀
token: ${{ secrets.GITHUB_TOKEN }}