-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (50 loc) · 1.67 KB
/
documentation.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
name: Documentation
on:
push:
branches:
- main
pull_request:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
env:
UPA_DEPLOY: ${{ github.ref == 'refs/heads/main' || '' }}
UPA_DOCS_REPOSITORY: upa-url/docs
UPA_DOCS_DIR: main
steps:
- uses: actions/checkout@v4
- name: Download theme
run: doc/download-theme.sh
- uses: mattnotmitt/doxygen-action@edge
- name: Is there a gh-pages branch?
if: env.UPA_DEPLOY
run: echo "UPA_CHECKOUT=$(git ls-remote --heads https://github.com/$UPA_DOCS_REPOSITORY.git refs/heads/gh-pages)" >> "$GITHUB_ENV"
- name: Checkout ${{ env.UPA_DOCS_REPOSITORY }}
uses: actions/checkout@v4
if: env.UPA_DEPLOY && env.UPA_CHECKOUT
with:
repository: ${{ env.UPA_DOCS_REPOSITORY }}
ref: gh-pages
path: build-docs
- name: Prepare directory for publication
if: env.UPA_DEPLOY
run: |
sudo chown --recursive $USER doc/html
mkdir -p build-docs
rm -rf build-docs/.git
rm -rf build-docs/common
rm -rf build-docs/${{ env.UPA_DOCS_DIR }}
cp -r doc/common build-docs/common
mv doc/html build-docs/${{ env.UPA_DOCS_DIR }}
cp doc/index.html build-docs
- name: Deploy to ${{ env.UPA_DOCS_REPOSITORY }}
uses: JamesIves/github-pages-deploy-action@v4
if: env.UPA_DEPLOY
with:
ssh-key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
repository-name: ${{ env.UPA_DOCS_REPOSITORY }}
folder: build-docs