-
Notifications
You must be signed in to change notification settings - Fork 6
103 lines (88 loc) · 3.61 KB
/
deploy.yml
File metadata and controls
103 lines (88 loc) · 3.61 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Deploy site
on:
workflow_dispatch:
repository_dispatch:
schedule:
- cron: '29 11 * * *'
pull_request:
push:
branches: [main]
jobs:
deploy:
name: Deploy 🚀 (if on main branch)
needs:
- build-core
- build-docs
- build-extras
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Download core site
uses: actions/download-artifact@v4.2.0
with:
name: core-site
path: site
- name: Download all docs
uses: actions/download-artifact@v4.2.0
with:
pattern: "*-docs"
path: site
merge-multiple: true
- name: Download tutorials
uses: actions/download-artifact@v4.2.0
with:
name: tutorials
path: site/tutorials
- name: Download rust tutorial
uses: actions/download-artifact@v4.2.0
with:
name: rust-tutorials
path: site/tutorials/rust
- name: Download tskit-explore
uses: actions/download-artifact@v4.2.0
with:
name: tskit-explore
path: site/explore
- name: Pages config and tweaks
run: |
touch site/.nojekyll
echo "tskit.dev" > site/CNAME
echo "<meta http-equiv=\"Refresh\" content=\"0; url=/msprime/docs/stable\" />" > site/msprime/docs/index.html
echo "<meta http-equiv=\"Refresh\" content=\"0; url=/tsinfer/docs/stable\" />" > site/tsinfer/docs/index.html
echo "<meta http-equiv=\"Refresh\" content=\"0; url=/tskit/docs/stable\" />" > site/tskit/docs/index.html
echo "<meta http-equiv=\"Refresh\" content=\"0; url=/pyslim/docs/stable\" />" > site/pyslim/docs/index.html
echo "<meta http-equiv=\"Refresh\" content=\"0; url=/tstrait/docs/stable\" />" > site/tstrait/docs/index.html
echo "<meta http-equiv=\"Refresh\" content=\"0; url=/tscompare/docs/stable\" />" > site/tscompare/docs/index.html
echo "<meta http-equiv=\"Refresh\" content=\"0; url=/tsbrowse/docs/stable\" />" > site/tsbrowse/docs/index.html
echo "<meta http-equiv=\"Refresh\" content=\"0; url=/tsdate/docs/stable\" />" > site/tsdate/docs/index.html
echo "<meta http-equiv=\"Refresh\" content=\"0; url=/tszip/docs/latest\" />" > site/tszip/docs/index.html
echo "<meta http-equiv=\"Refresh\" content=\"0; url=/sc2ts/docs/stable\" />" > site/sc2ts/docs/index.html
echo "<meta http-equiv=\"Refresh\" content=\"0; url=/kastore/docs/stable\" />" > site/kastore/docs/index.html
- name: Inject analytics code
run: |
# Find all HTML files and inject analytics code before closing </head> tag
find site -type f \( -name "*.html" -o -name "*.htm" \) -exec sed -i 's|</head>|<script data-goatcounter="https://tskit.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>\n</head>|' {} \;
- name: List site contents
run: |
ls -R
- name: Upload site (for PR inspection)
uses: actions/upload-artifact@v4.6.1
with:
name: site
path: .
- name: Deploy
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4.7.3
with:
token: ${{ secrets.ADMINBOT_TOKEN }}
branch: gh-pages
folder: site
single-commit: true
# These are the other workflow jobs that this deployment depends on
build-core:
uses: ./.github/workflows/build-core.yml
build-docs:
uses: ./.github/workflows/build-docs.yml
build-extras:
uses: ./.github/workflows/build-extras.yml