@@ -13,76 +13,71 @@ jobs:
13
13
runs-on : ubuntu-latest
14
14
permissions :
15
15
contents : write
16
- # if: ${{ github.event.workflow_run.conclusion == 'success' }}
17
16
steps :
18
17
19
- - name : 📥 Checkout repository
20
- uses : actions/checkout@v4
21
- with :
22
- repository : cardano-scaling/hydra
23
- ref : release
24
- # Also ensure we have all history with all tags
25
- fetch-depth : 0
26
-
27
18
- name : ❄ Setup Nix/Cachix
28
19
uses : ./.github/actions/nix-cachix-setup
29
20
with :
30
21
authToken : ' ${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'
31
22
32
- - name : Build stable (i.e. from `release`) documentation
33
- working-directory : docs
34
- run : |
35
- nix build .#docs
36
-
37
- export out=/tmp/public/head-protocol
38
- mkdir -p $out
39
- cp result/build/* $out -r
23
+ - name : 📥 Checkout repository
24
+ uses : actions/checkout@v4
40
25
41
- nix develop .#hydra-node-bench --command -- tx-cost --output-directory $out/benchmarks/
42
- nix develop .#hydra-node-bench --command -- micro -o $out/benchmarks/ledger-bench.html
43
- nix develop .#hydra-cluster-bench --command -- bench-e2e datasets datasets/1-node.json datasets/3-nodes.json --output-directory $out/benchmarks
26
+ - name : Build documentation and compute benchmarks
27
+ run : |
44
28
45
- # Clean the working copy
46
- git clean -dxf
29
+ # Release
30
+ DERIVATION=docs
31
+ OUT_PATH=
47
32
48
- - name : Checkout master
49
- working-directory : docs
50
- run : |
51
- git reset origin/master --hard
52
- sed -i 's|head-protocol|head-protocol/unstable|' docusaurus.config.js
33
+ [[ ${{ github.ref_name }} = "master" ]] && \
34
+ DERIVATION=docs-unstable && \
35
+ OUT_PATH=/unstable
53
36
54
- - name : Build /unstable documentation
55
- working-directory : docs
56
- run : |
57
- nix build .#docs
37
+ nix build .#${DERIVATION}
58
38
59
- export out=/tmp/public/head-protocol/unstable
39
+ export out=/tmp/public/head-protocol${OUT_PATH}
60
40
mkdir -p $out
61
41
cp result/build/* $out -r
62
42
63
43
nix develop .#hydra-node-bench --command -- tx-cost --output-directory $out/benchmarks/
64
44
nix develop .#hydra-node-bench --command -- micro -o $out/benchmarks/ledger-bench.html
65
- nix develop .#hydra-cluster-bench --command -- bench-e2e datasets datasets/1-node.json datasets/3-nodes.json --output-directory $out/benchmarks
66
-
45
+ nix develop .#hydra-cluster-bench --command -- \
46
+ bench-e2e \
47
+ datasets \
48
+ hydra-cluster/datasets/1-node.json \
49
+ hydra-cluster/datasets/3-nodes.json \
50
+ --output-directory $out/benchmarks
67
51
68
52
- name : 👉 Create redirects
69
53
run : |
54
+
70
55
function redirect() {
71
56
echo "Creating redirect: $1 -> $2"
72
57
mkdir -p $(dirname $1)
73
58
echo "<!DOCTYPE html><html><head><meta http-equiv=\"Refresh\" content=\"0; URL=${2}\"></head></html>" > $1
74
59
}
75
60
echo "hydra.family" > /tmp/public/CNAME
61
+ touch /tmp/public/.nojekyll
62
+
76
63
redirect /tmp/public/index.html https://hydra.family/head-protocol
64
+
77
65
# Monthly reports moved to scaling website (2024-02-29)
66
+
78
67
rm -rf /tmp/public/head-protocol/monthly
68
+
69
+ # Note: This runs on pushes to either branch, but it doesn't matter as
70
+ # it doesn't hurt to write these files twice.
71
+
79
72
redirect /tmp/public/head-protocol/monthly/index.html https://cardano-scaling.github.io/website/monthly
80
73
redirect /tmp/public/head-protocol/unstable/monthly/index.html https://cardano-scaling.github.io/website/monthly
81
74
82
75
- name : 🚢 Publish Documentation
83
- uses : peaceiris/actions-gh- pages@v4
76
+ uses : JamesIves/github- pages-deploy-action @v4
84
77
with :
85
- github_token : ${{ secrets.GITHUB_TOKEN || github.token }}
86
- publish_dir : /tmp/public
87
- enable_jekyll : true
88
- force_orphan : true
78
+ token : ${{ secrets.GITHUB_TOKEN || github.token }}
79
+ folder : /tmp/public
80
+ # Note: This is crucial! We _never_ remove files that we have
81
+ # previously uploaded. This might be surprising if we expect something
82
+ # we previously uploaded to be _removed_!
83
+ clean : false
0 commit comments