Skip to content

Commit

Permalink
XXX
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 24, 2025
1 parent 5559930 commit f2a8305
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ notifications:
issues_status: issues@arrow.apache.org
issues_comment: github@arrow.apache.org
pullrequests: github@arrow.apache.org
publish:
whoami: asf-site
subdir: java
65 changes: 65 additions & 0 deletions .github/workflows/rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,71 @@ jobs:
with:
name: release-html
path: html.tar.gz
public-docs:
name: Publish docs
# Run only when:
# * We push to a branch
# * If the target repository is apache/arrow-java:
# * The target branch is main
# * Else (fork repositories):
# * All branches
if: >-
github.event_name == 'push' &&
github.ref_type == 'branch' &&
((github.repository == 'apache/arrow-java' && github.ref_name == 'main') ||
github.repository != 'apache/arrow-java')
needs:
- docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: site
persist-credentials: true
- name: Prepare branch
run: |
if [ "${GITHUB_REPOSITORY}" = "apache/arrow-java" ]; then
BRANCH=asf-site
else
BRANCH=gh-pages
fi
echo "BRANCH=${BRANCH}" >> ${GITHUB_ENV}
cp site/.asf.yaml ./
cd site
git fetch
if ! git switch -c "${BRANCH}" "origin/${BRANCH}"; then
git switch --orphan "${BRANCH}"
fi
cp ../.asf.yaml site/
git -C site add .asf.yaml
- name: Download
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: release-html
- name: Extract
run: |
tar -xf html.tar.gz
rm -rf site/main
mv html site/main
git -C site add main
if [ "$(git status --prcelain)" == "" ]; then
NEED_PUSH=true
else
NEED_PUSH=false
fi
echo "NEED_PUSH=${NEED_PUSH}" >> ${GITHUB_ENV}
- name: Push
if: env.NEED_PUSH == 'true'
run: |
cd site
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git commit -m "Publish documentation (${GITHUB_SHA})"
git push origin "${BRANCH}"
verify:
name: Verify
needs:
Expand Down

0 comments on commit f2a8305

Please sign in to comment.