-
Notifications
You must be signed in to change notification settings - Fork 476
86 lines (75 loc) · 2.8 KB
/
haddock-site.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# This workflow builds and publishes the Haddock site to:
# https://plutus.cardano.intersectmbo.org/haddock/$version
# And optionally to:
# https://plutus.cardano.intersectmbo.org/haddock/latest
# On push to master, this workflows publishes to:
# https://plutus.cardano.intersectmbo.org/haddock/master
name: "📜 Haddock Site"
on:
push:
branches:
- master
workflow_dispatch:
inputs:
ref:
description: |
The ref to build off of, e.g. "1.29.0.0", "master", or any other valid git ref.
When making a release, this is usually the version tag, e.g. "1.29.0.0", and will be
equal to the $destination input below. When back-porting this could be a commit sha instead.
required: true
type: string
destination:
description: |
The destination folder, e.g. when "1.29.0.0" the haddock site will be deployed to:
https://plutus.cardano.intersectmbo.org/haddock/1.29.0.0
required: true
type: string
latest:
description: |
If true, then the haddock site will also be deployed to:
https://plutus.cardano.intersectmbo.org/haddock/latest.
You want to check this when you are making a release.
You want to uncheck this when you are deploying old versions or back-porting.
type: boolean
required: true
default: true
script_ref:
description: |
What branch to fetch the combined-haddock.sh script from.
Leave this to 'master' unless you are testing a new version of the script.
type: string
required: true
default: 'master'
jobs:
deploy:
name: Deploy
runs-on: [self-hosted, plutus-ci]
permissions:
contents: write
environment:
name: github-pages
steps:
- name: Checkout
uses: actions/checkout@main
with:
ref: ${{ inputs.ref || github.ref_name }}
- name: Checkout Haddock Script
run: |
git fetch origin ${{ inputs.script_ref || github.ref_name }}
git checkout origin/${{ inputs.script_ref || github.ref_name }} ./scripts/combined-haddock.sh
- name: Build Site
run: |
nix develop --no-warn-dirty --accept-flake-config --command ./scripts/combined-haddock.sh _haddock all
- name: Deploy Site
uses: JamesIves/[email protected]
with:
folder: _haddock
target-folder: haddock/${{ inputs.destination || github.ref_name }}
single-commit: true
- name: Deploy Site (latest)
if: ${{ inputs.latest == true }}
uses: JamesIves/[email protected]
with:
folder: _haddock
target-folder: haddock/latest
single-commit: true