Skip to content

Upload dev docs

Upload dev docs #1414

Workflow file for this run

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Upload dev docs
on:
push:
paths:
- ".github/workflows/devdocs.yml"
pull_request:
paths:
- ".github/workflows/devdocs.yml"
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
permissions:
contents: write
jobs:
devdocs:
name: Fetch and upload dev docs
runs-on: ubuntu-latest
steps:
- name: Checkout Arrow
uses: actions/checkout@v5
with:
repository: apache/arrow
path: arrow
- name: Checkout Crossbow
uses: actions/checkout@v5
with:
repository: ursacomputing/crossbow
path: crossbow
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3
cache: 'pip'
- name: Install archery
run: |
pip install -e arrow/dev/archery[crossbow]
- name: Identify latest doc build
run: |
echo "LATEST=$(archery crossbow latest-prefix --no-fetch nightly-tests)" >> "${GITHUB_ENV}"
- name: Download the crossbow docs artifact
run: |
archery crossbow \
--queue-path ./crossbow \
download-artifacts \
--no-fetch \
--task-filter "*docs" \
--target-dir downloads \
${LATEST}
- uses: actions/checkout@v5
with:
ref: asf-site
path: asf-site
- name: Prepare docs
run: |
cd asf-site
echo "$(git log -1)"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
rm -rf docs/dev
mkdir -p docs/dev
tar \
-xvzf ../downloads/${LATEST}/test-debian-*-docs/docs.tar.gz \
-C docs/dev \
--strip-components=1
cp docs/c_glib/index.html docs/dev/c_glib/index.html
git status --porcelain
- name: Publish docs
if: >-
github.repository == 'apache/arrow-site' &&
(github.event_name == 'workflow_dispatch' ||
github.event_name == 'schedule')
run: |
cd asf-site
if [ "$(git status --porcelain)" != "" ]; then
# There are changes to the dev docs
git add docs/dev
git commit -m "Updating dev docs (build ${{ steps.build.outputs.LATEST }})"
echo "git push"
git push
else
echo "No changes to the built site"
fi