-
Notifications
You must be signed in to change notification settings - Fork 6
74 lines (63 loc) · 1.93 KB
/
docs.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
name: Deploy documentation
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pages: write # To push to a GitHub Pages site
id-token: write # To update the deployment status
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Store version in environment
run: |
TAG=$(git describe --tags --always --abbrev=0)
echo "CY_VERSION=${TAG:1}" >> $GITHUB_ENV
- name: Install latest mdbook
run: |
tag="v0.4.35"
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.23"
- uses: charmbracelet/vhs-action@v2
- name: Install vim and htop
# For the "cy/project" story and "layout/dynamic/color-map" story
run: sudo apt-get install -qqy vim htop
- name: Build
run: >
go build
-ldflags "-X github.com/cfoust/cy/pkg/version.Version=${CY_VERSION}"
-o docs/storybook
./cmd/stories/...
- name: Install the latest VHS
run: |
git clone https://github.com/charmbracelet/vhs.git
cd vhs
go build -o ../vhs-bin .
cd ..
rm -r vhs
mv vhs-bin docs/vhs
- name: Build book
run: |
cd docs
mdbook build
- name: Setup pages
uses: actions/configure-pages@v2
- name: Upload site
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: "docs/book"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1