Skip to content

Commit e52611e

Browse files
committed
Added automation for generating/publishing docs
1 parent 4614ffd commit e52611e

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/publish-docs.yaml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Publish Documentation
2+
on:
3+
workflow_dispatch: {}
4+
push:
5+
paths:
6+
- 'docs/**'
7+
branches: ['main', '[1-9].[0-9].x']
8+
9+
jobs:
10+
publish-docs:
11+
if: github.repository_owner == 'Apicurio'
12+
runs-on: ubuntu-20.04
13+
steps:
14+
15+
- name: Apicurio Website Checkout
16+
run: |
17+
mkdir website
18+
cd website
19+
git init
20+
git config --global user.name "apicurio-ci"
21+
git config --global user.email "apicurio.ci@gmail.com"
22+
git remote add origin "https://apicurio-ci:${{ secrets.ACCESS_TOKEN }}@github.com/Apicurio/apicurio.github.io.git"
23+
git fetch
24+
git checkout main
25+
git branch --set-upstream-to=origin/main
26+
git pull
27+
28+
- name: Apicurio Registry Checkout
29+
run: |
30+
mkdir registry
31+
cd registry
32+
git init
33+
git config --global user.name "apicurio-ci"
34+
git config --global user.email "apicurio.ci@gmail.com"
35+
git remote add origin "https://apicurio-ci:${{ secrets.ACCESS_TOKEN }}@github.com/Apicurio/apicurio-registry.git"
36+
git fetch
37+
git checkout main
38+
git branch --set-upstream-to=origin/main
39+
git pull
40+
41+
- name: Generate Documentation
42+
run: |
43+
cd registry/docs-playbook
44+
./_build-all.sh
45+
46+
- name: Copy Documentation to Website
47+
run: |
48+
rm -rf website/registry/docs
49+
cp -rf registry/docs-playbook/target/dist website/registry/docs
50+
51+
- name: Commit Documentation to Website
52+
run: |
53+
cd website
54+
git add .
55+
git commit -m "Automated Publishing of Documentation for Apicurio Registry"
56+
git push
57+
58+
- name: Google Chat Notification
59+
if: ${{ failure() }}
60+
uses: Co-qn/google-chat-notification@b9227d9daa4638c9782a5bd16c4abb86268127a1
61+
with:
62+
name: ${{ github.job }}
63+
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK }}
64+
status: ${{ job.status }}
65+
66+
- name: Google Chat Notification (Error)
67+
if: failure()
68+
uses: Co-qn/google-chat-notification@b9227d9daa4638c9782a5bd16c4abb86268127a1
69+
with:
70+
name: ${{ github.job }}
71+
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_ERRORS }}
72+
status: ${{ job.status }}

0 commit comments

Comments
 (0)