Repository navigation
65 lines (51 loc) · 1.84 KB
/
Copy pathdeploy.yml
File metadata and controls
65 lines (51 loc) · 1.84 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
name: MyST GitHub Pages Deploy
on:
push:
branches:
- main
env:
# `BASE_URL` determines, relative to the root of the domain, the URL that your site is served from.
# E.g., if your site lives at `https://mydomain.org/myproject`, set `BASE_URL=/myproject`.
# If, instead, your site lives at the root of the domain, at `https://mydomain.org`, set `BASE_URL=''`.
BASE_URL: ${{ vars.BASE_URL }}
# `DOMAIN` is a workaround for https://github.com/jupyter-book/myst-theme/issues/669:
# - robots.txt,sitemap.xml as well as some other files use "localhost:3000" url
DOMAIN: ${{ vars.DOMAIN }}
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-24.04
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v6
- uses: actions/configure-pages@v6
- uses: mamba-org/setup-micromamba@v3
with:
environment-file: environment.yml
- run: |
if [ ${{ github.repository }} = ua-asf/nisar-docs ]; then
echo 'Uncommenting Google Analytics tag'
sed -i 's/# analytics_google:/analytics_google:/' myst.yml
fi
myst build --html
cp -v _build/html/404/index.html _build/html/404.html
sed -i -e "s|BASE_URL|$BASE_URL|g" $(grep -rl BASE_URL redirects/)
cp -rv redirects/*/ _build/html/
sed -i -e "s|http://localhost:3000|$DOMAIN$BASE_URL|g" $(grep -RIl "http://localhost:3000" ./_build)
sed -i "s|</loc>|/</loc>|g" ./_build/html/sitemap.xml
- uses: actions/upload-pages-artifact@v4
with:
path: "./_build/html"
- id: deployment
uses: actions/deploy-pages@v4