Skip to content

Commit b62c46a

Browse files
committed
docs: github pages deployment
Signed-off-by: Jan Larwig <jan@larwig.com>
1 parent aca40d1 commit b62c46a

2 files changed

Lines changed: 71 additions & 75 deletions

File tree

.github/workflows/docs.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- .github/workflows/publish-docs.yml
9+
- common.mk
10+
- versions.mk
11+
- docs/**
12+
- hack/tools/**
13+
pull_request:
14+
paths:
15+
- .github/workflows/publish-docs.yml
16+
- common.mk
17+
- versions.mk
18+
- docs/**
19+
- hack/tools/**
20+
workflow_dispatch:
21+
22+
permissions:
23+
contents: read
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.ref }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
build:
31+
name: Build mdBook
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Clone the code
35+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
36+
with:
37+
persist-credentials: false
38+
39+
- name: Setup Go
40+
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
41+
with:
42+
go-version-file: go.mod
43+
44+
- name: Configure GitHub Pages
45+
if: github.ref == 'refs/heads/main'
46+
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0di # v6.0.0
47+
48+
- name: Build docs
49+
run: make -C docs build
50+
51+
- name: Upload GitHub Pages artifact
52+
if: github.ref == 'refs/heads/main'
53+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
54+
with:
55+
path: docs/book
56+
57+
publish:
58+
name: Deploy docs to GitHub Pages
59+
if: github.ref == 'refs/heads/main'
60+
needs: build
61+
runs-on: ubuntu-latest
62+
permissions:
63+
pages: write
64+
id-token: write
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
steps:
69+
- name: Deploy to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0

.github/workflows/publish-docs.yml

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)