Skip to content

Commit f24a53d

Browse files
authored
Add initial workflow for building API docs
1 parent 3c63d42 commit f24a53d

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/pages.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy API docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
schedule:
7+
- cron: "0 0 * * *"
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
env:
14+
CC: clang
15+
CI_CUBERITE_BUILD_TYPE: Release
16+
CI_JOB_NUMBER: ${{ github.run_number }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
repository: cuberite/cuberite
21+
submodules: recursive
22+
23+
- name: Setup cache
24+
uses: actions/cache@v4
25+
with:
26+
path: /home/runner/.cache/ccache
27+
key: ccache
28+
29+
- name: Setup Pages
30+
id: pages
31+
uses: actions/configure-pages@v5
32+
33+
- name: Install ccache
34+
run: sudo apt -y install ccache
35+
36+
- name: Build API docs
37+
continue-on-error: true
38+
run: |
39+
export PATH="/usr/lib/ccache:$PATH"
40+
./cibuild.sh
41+
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: ${{ env.CC }}_${{ env.CI_CUBERITE_BUILD_TYPE}}/Server/API/
46+
47+
deploy:
48+
needs: build
49+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
50+
permissions:
51+
pages: write # to deploy to Pages
52+
id-token: write # to verify the deployment originates from an appropriate source
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)