Skip to content

Commit 0c15f49

Browse files
authored
Deploy sites by official actions (#1350)
* Move dokka step into .github/actions/deploy-site/action.yml * Use `actions/upload-pages-artifact` and `actions/deploy-pages` Refs https://github.com/squidfunk/mkdocs-material/blob/0e75aef9ea9028dc5a2dea34fb5da8afb14911ae/.github/workflows/documentation.yml#L92-L112
1 parent 8464ed0 commit 0c15f49

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

.github/actions/deploy-site/action.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ description: 'Deploy site to GitHub Pages'
44
runs:
55
using: 'composite'
66
steps:
7-
- name: Deploy Site
7+
- uses: gradle/actions/setup-gradle@v4
8+
with:
9+
cache-read-only: true
10+
- name: Prepare API documentation
11+
shell: bash
12+
run: ./gradlew dokkaHtml --no-configuration-cache
13+
- name: Build Site
814
shell: bash
915
run: |
10-
git config --global user.name 'github-actions[bot]'
11-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
1216
# Don't cache it to track updates.
1317
pip install mkdocs-material
14-
# Incremental pushes, make sure gh-pages branch is fetched by checkout.
15-
mkdocs gh-deploy
18+
mkdocs build
19+
- uses: actions/upload-pages-artifact@v3
20+
with:
21+
path: site
22+
- uses: actions/deploy-pages@v4

.github/workflows/deploy.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,4 @@ jobs:
1414
with:
1515
# Fetch all tags and branches, so that MkDocs could push incremental updates.
1616
fetch-depth: 0
17-
- uses: gradle/actions/setup-gradle@v4
18-
with:
19-
cache-read-only: true
20-
# Prepare API documentations for MkDocs.
21-
- run: ./gradlew dokkaHtml --no-configuration-cache
2217
- uses: ./.github/actions/deploy-site

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
cache-read-only: true
2626
# Disable CC due to https://github.com/gradle/gradle/issues/22779
27-
- run: ./gradlew publish publishPlugins dokkaHtml --no-configuration-cache
27+
- run: ./gradlew publish publishPlugins --no-configuration-cache
2828
env:
2929
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_KEY }}
3030
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_SECRET }}

0 commit comments

Comments
 (0)