-
Notifications
You must be signed in to change notification settings - Fork 391
65 lines (58 loc) · 1.82 KB
/
gh-pages.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
# generate Go docs and publish on gh-pages branch
# Live at: https://gnolang.github.io/gno
name: GitHub pages (godoc & stdlib_diff) build and deploy
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
if: github.repository == 'gnolang/gno' # Alternatively, validate based on provided tokens and permissions.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
# Use the goroot at the top of the project to compare with the GnoVM
# stdlib, rather than the one in stdlib_diff (which may have a go.mod with
# a different toolchain version).
- run: echo "GOROOT_SAVE=$(go env GOROOT)" >> $GITHUB_ENV
- run: "cd misc/stdlib_diff && make gen"
- run: "cd misc/gendocs && make install gen"
- run: "mkdir -p pages_output/stdlib_diff"
- run: |
cp -r misc/gendocs/godoc/* pages_output/
cp -r misc/stdlib_diff/stdlib_diff/* pages_output/stdlib_diff/
# These two last steps will be skipped on pull requests
- uses: actions/configure-pages@v5
id: pages
if: github.event_name != 'pull_request'
- uses: actions/upload-pages-artifact@v3
if: github.event_name != 'pull_request'
with:
path: ./pages_output
deploy:
if: >
github.repository == 'gnolang/gno' &&
github.ref == 'refs/heads/master' &&
github.event_name == 'push'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
steps:
- uses: actions/deploy-pages@v4
id: deployment