-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (76 loc) · 2.2 KB
/
publish.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
87
88
name: Publish
env:
HUGO_VERSION: mojo-lexer # 0.140.2
on:
push:
branches:
- main
pull_request:
jobs:
publish:
name: Generate and publish docs
runs-on: ubuntu-latest
steps:
- name: Checkout Modo
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.23.x'
- name: Install dependencies
run: go get .
- name: Install magic CLI
run: |
curl -ssL https://magic.modular.com | bash
source /home/runner/.bash_profile
- name: Install mojo and dependencies
run: |
source /home/runner/.bash_profile
cd docs
magic install --locked
- name: Clone Hugo
run: |
git clone https://github.com/mlange-42/hugo.git
cd hugo
git checkout ${{env.HUGO_VERSION}}
- name: Install Hugo
run: |
cd hugo
go install .
#- name: Setup Hugo
# uses: peaceiris/actions-hugo@v3
# with:
# hugo-version: '${{env.HUGO_VERSION}}'
# extended: true
- name: Run Modo # includes `mojo doc` and `mojo test`
run: |
source /home/runner/.bash_profile
go run . build docs
- name: Run Hugo
run: |
hugo -s docs/docs/site
- name: Install reveal-md
run: |
npm install --global reveal-md
- name: Build slides
run: |
cd docs/docs/slides
reveal-md slides.md --static ../site/public/slides --static-dirs=.nojekyll,img
- name: Archive Markdown artifacts
uses: actions/upload-artifact@v4
with:
name: markdown
path: docs/docs/site/content
- name: Archive HTML artifacts
uses: actions/upload-artifact@v4
with:
name: public
path: docs/docs/site/public
- name: Deploy to GitHub Pages
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: docs/docs/site/public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}