Skip to content

Commit 1ccdcca

Browse files
authored
Update the github action to leverage mike for versioned doc (#88)
1 parent 0e6fe51 commit 1ccdcca

File tree

2 files changed

+16
-40
lines changed

2 files changed

+16
-40
lines changed

.github/workflows/packaging.yml

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121
push:
2222
branches:
2323
- main
24+
- 'branch-*'
2425
tags:
2526
- 'apache-sedona-db-*-rc*'
2627
pull_request:
@@ -72,10 +73,12 @@ jobs:
7273
path: |
7374
apache-sedona-db-${{ env.VERSION }}.tar.gz
7475
75-
docs:
76+
docs-and-deploy:
7677
runs-on: ubuntu-latest
7778
env:
7879
CARGO_INCREMENTAL: 0
80+
permissions:
81+
contents: write
7982

8083
steps:
8184
- uses: actions/checkout@v4
@@ -126,53 +129,25 @@ jobs:
126129
path: |
127130
docs.tgz
128131
129-
update-asf-site:
130-
runs-on: ubuntu-latest
131-
needs:
132-
- docs
133-
permissions:
134-
contents: write
135-
136-
steps:
137-
- uses: actions/download-artifact@v4
138-
with:
139-
name: docs
140-
141-
- name: Clone asf-site branch
142-
uses: actions/checkout@v4
143-
with:
144-
ref: asf-site
145-
path: pages-clone
146-
147-
- name: Update development documentation
148-
env:
149-
DOC_TAG: "dev-snapshot-main"
150-
132+
- name: Deploy the doc to the website branch
133+
if: ${{ github.event_name != 'pull_request' && github.repository == 'apache/sedona-db' }}
151134
run: |
152135
git config --global user.email "[email protected]"
153136
git config --global user.name "GitHub Actions"
154-
155-
cd pages-clone
156-
if [ -d "$DOC_TAG" ]; then
157-
git rm -rf "$DOC_TAG"
137+
git fetch origin asf-site --depth=1
138+
139+
if [[ "${GITHUB_REF##*/}" == "main" ]]; then
140+
mike deploy latest-snapshot -b asf-site -p
141+
elif [[ "${GITHUB_REF##*/}" =~ ^branch-[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
142+
version="${GITHUB_REF##*/branch-}"
143+
mike deploy --update-aliases "$version" latest -b asf-site -p
144+
mike set-default latest -b asf-site -p
158145
fi
159146
160-
tar -xf ../docs.tgz
161-
mv sedona-db-docs "$DOC_TAG"
162-
163-
git add *
164-
git commit --allow-empty -m"update documentation for tag $DOC_TAG"
165-
166-
- name: Push development documentation to asf-site
167-
if: success() && github.repository == 'apache/sedona-db' && github.ref == 'refs/heads/main'
168-
run: |
169-
cd pages-clone
170-
git push
171-
172147
create-release:
173148
runs-on: ubuntu-latest
174149
needs:
175-
- docs
150+
- docs-and-deploy
176151
- source
177152
permissions:
178153
contents: write

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ __pycache__
4646

4747
# R-related files
4848
.Rproj.user
49+
*

0 commit comments

Comments
 (0)