|
21 | 21 | push: |
22 | 22 | branches: |
23 | 23 | - main |
| 24 | + - 'branch-*' |
24 | 25 | tags: |
25 | 26 | - 'apache-sedona-db-*-rc*' |
26 | 27 | pull_request: |
@@ -72,10 +73,12 @@ jobs: |
72 | 73 | path: | |
73 | 74 | apache-sedona-db-${{ env.VERSION }}.tar.gz |
74 | 75 |
|
75 | | - docs: |
| 76 | + docs-and-deploy: |
76 | 77 | runs-on: ubuntu-latest |
77 | 78 | env: |
78 | 79 | CARGO_INCREMENTAL: 0 |
| 80 | + permissions: |
| 81 | + contents: write |
79 | 82 |
|
80 | 83 | steps: |
81 | 84 | - uses: actions/checkout@v4 |
@@ -126,53 +129,25 @@ jobs: |
126 | 129 | path: | |
127 | 130 | docs.tgz |
128 | 131 |
|
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' }} |
151 | 134 | run: | |
152 | 135 | git config --global user.email "[email protected]" |
153 | 136 | 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 |
158 | 145 | fi |
159 | 146 |
|
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 | | -
|
172 | 147 | create-release: |
173 | 148 | runs-on: ubuntu-latest |
174 | 149 | needs: |
175 | | - - docs |
| 150 | + - docs-and-deploy |
176 | 151 | - source |
177 | 152 | permissions: |
178 | 153 | contents: write |
|
0 commit comments