-
Notifications
You must be signed in to change notification settings - Fork 7
53 lines (48 loc) · 1.34 KB
/
docs.yaml
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
name: Build Docs
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- .github/workflows/docs*
- docs/**
- Gemfile
jobs:
deploy:
if: github.repository == 'openstack-k8s-operators/watcher-operator'
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
- uses: actions/checkout@v4
with:
# this fetches all branches. Needed because we need gh-pages branch for deploy to work
fetch-depth: 0
- uses: ruby/[email protected]
with:
ruby-version: '3.2'
- name: Build docs
run: |
make docs
cp docs_build/watcher-operator/index.html index.html
- name: Prepare gh-pages branch
run: |
git config user.name github-actions
git config user.email [email protected]
git branch -D gh-pages &>/dev/null || true
git checkout --orphan gh-pages
git reset
- name: Commit asciidoc docs
run: |
git add index.html
git commit -m "Rendered docs"
- name: Push rendered docs to gh-pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git push --force origin gh-pages