Skip to content

Commit fc49f93

Browse files
committed
Custom deployments for branches
1 parent 0e7e291 commit fc49f93

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/docs-branch.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docs Branch
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
paths:
7+
- 'dokka/**'
8+
- 'src/main/**'
9+
- '.github/workflows/docs-branch.yml'
10+
11+
concurrency:
12+
group: pages-${{ github.ref_name }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
deployments: write
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
fetch-depth: 0
25+
- uses: actions/setup-java@v4
26+
with:
27+
java-version: 17
28+
distribution: zulu
29+
cache: gradle
30+
- name: Build docs
31+
run: ./gradlew --no-daemon dokkaHtml dokkaJavadoc
32+
- name: Copy javadoc subfolder
33+
run: mv build/dokka/javadoc build/dokka/html/
34+
- uses: actions/upload-pages-artifact@v1
35+
with:
36+
path: 'build/dokka/html'
37+
- uses: cloudflare/pages-action@v1
38+
with:
39+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
40+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
41+
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
42+
directory: build/dokka/html
43+
branch: ${{ github.ref_name }}
44+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)