|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +{% import 'macros.jinja' as macros with context %} |
| 19 | +{% set pr_number = pr_number|replace("Unset", arrow.branch) %} |
| 20 | +{{ macros.github_header() }} |
| 21 | + |
| 22 | +jobs: |
| 23 | + test: |
| 24 | + name: Docs Preview |
| 25 | + runs-on: ubuntu-latest |
| 26 | +{{ macros.github_set_env(env) }} |
| 27 | + steps: |
| 28 | + {{ macros.github_checkout_arrow(fetch_depth=fetch_depth|default(1))|indent }} |
| 29 | + {{ macros.github_install_archery()|indent }} |
| 30 | + |
| 31 | + - name: Execute Docker Build |
| 32 | + shell: bash |
| 33 | + env: |
| 34 | + ARROW_JAVA_SKIP_GIT_PLUGIN: true |
| 35 | + run: | |
| 36 | + archery docker run \ |
| 37 | + -e SETUPTOOLS_SCM_PRETEND_VERSION="{{ arrow.no_rc_version }}" \ |
| 38 | + {{ flags|default("") }} \ |
| 39 | + {{ image }} \ |
| 40 | + {{ command|default("") }} |
| 41 | + - name: Checkout Crossbow |
| 42 | + uses: actions/checkout@v3 |
| 43 | + with: |
| 44 | + ref: {{ default_branch|default("master") }} |
| 45 | + path: crossbow |
| 46 | + fetch-depth: 1 |
| 47 | + - name: Move docs |
| 48 | + run: | |
| 49 | + # build files are created by the docker user |
| 50 | + sudo chown -R ${USER}: build |
| 51 | + PR_DIR=crossbow/docs/pr_docs/{{ pr_number }} |
| 52 | + mkdir -p $PR_DIR |
| 53 | + rsync -a --delete build/docs/ $PR_DIR |
| 54 | + - name: Push changes |
| 55 | + run: | |
| 56 | + cd crossbow |
| 57 | + git config --local user.name "Github Actions" |
| 58 | + git config --local user.email "[email protected]" |
| 59 | + |
| 60 | + URL_PATH=pr_docs/{{ pr_number }} |
| 61 | + URL=https://crossbow.voltrondata.com/$URL_PATH |
| 62 | +
|
| 63 | + git add docs/$URL_PATH |
| 64 | + git commit -m "Add docs preview for PR {{ pr_number }}" |
| 65 | + git push |
| 66 | + echo ":open_book: You can find the preview here: $URL" >> $GITHUB_STEP_SUMMARY |
0 commit comments