forked from sqldelight/sqldelight
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (61 loc) · 2.19 KB
/
Publish-Website.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Publish the mkdocs to GitHub Pages
on:
push:
branches: [master]
release:
types: [published]
workflow_dispatch:
concurrency:
group: "docs"
cancel-in-progress: false
jobs:
deploy-website:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- uses: actions/configure-pages@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version-file: .github/workflows/.ci-java-version
- name: Setup gradle
uses: gradle/gradle-build-action@v3
with:
gradle-home-cache-cleanup: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11 # See the pinned version in renovate.json too
- name: Get Docs Version
run: cat gradle.properties | grep --color=never VERSION_NAME >> $GITHUB_OUTPUT
id: version
- name: Prep mkdocs
run: |
pip3 install --no-deps -r .github/workflows/requirements.txt
.github/workflows/prepare_mkdocs.sh ${{ steps.version.outputs.VERSION_NAME }}
- name: Configure git for mike
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git fetch origin gh-pages --depth=1
- name: Deploy SNAPSHOT Docs with mike 🗿
env:
SQLDELIGHT_VERSION: ${{ steps.version.outputs.VERSION_NAME }}
if: ${{ success() && contains(steps.version.outputs.VERSION_NAME, 'SNAPSHOT') }}
run: mike deploy -u --push ${{ steps.version.outputs.VERSION_NAME }} snapshot
- name: Deploy Docs with mike 🚀
env:
SQLDELIGHT_VERSION: ${{ steps.version.outputs.VERSION_NAME }}
if: ${{ success() && !contains(steps.version.outputs.VERSION_NAME , 'SNAPSHOT') }}
run: mike deploy -u --push ${{ steps.version.outputs.VERSION_NAME }} latest
env:
GRADLE_OPTS: -Dorg.gradle.caching=true