Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate Arrow version to publish_doc job #2633

Merged
merged 1 commit into from
Jan 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 26 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ jobs:
timeout-minutes: 120
runs-on: macos-latest

outputs:
arrow-version: ${{ steps.get-arrow-version.outputs.arrow-version }}

steps:
- uses: actions/checkout@v2
with:
Expand All @@ -85,6 +88,10 @@ jobs:
distribution: 'zulu'
java-version: 11

- id: get-arrow-version
name: Get Arrow version
run: echo "::set-output name=arrow-version::${{needs.build.outputs.arrow-version}}"

- name: Publish alpha/beta/rc version
uses: gradle/[email protected]
if: |
Expand Down Expand Up @@ -159,41 +166,41 @@ jobs:
- name: Build release directory (/docs)
working-directory: arrow-site
if: |
!contains(needs.build.outputs.arrow-version, 'alpha') &&
!contains(needs.build.outputs.arrow-version, 'beta') &&
!contains(needs.build.outputs.arrow-version, 'rc')
!contains(needs.publish.outputs.arrow-version, 'alpha') &&
!contains(needs.publish.outputs.arrow-version, 'beta') &&
!contains(needs.publish.outputs.arrow-version, 'rc')
run: |
bundle exec jekyll build -b docs -s docs
tree _site > $BASEDIR/logs/content_docs-${{ needs.build.outputs.arrow-version }}.log
tree _site > $BASEDIR/logs/content_docs-${{ needs.publish.outputs.arrow-version }}.log

- name: Publish documentation (/docs)
working-directory: arrow-site
if: |
!contains(needs.build.outputs.arrow-version, 'alpha') &&
!contains(needs.build.outputs.arrow-version, 'beta') &&
!contains(needs.build.outputs.arrow-version, 'rc')
!contains(needs.publish.outputs.arrow-version, 'alpha') &&
!contains(needs.publish.outputs.arrow-version, 'beta') &&
!contains(needs.publish.outputs.arrow-version, 'rc')
run: |
echo ">>> Latest release" >> $BASEDIR/logs/aws_sync.log
${GITHUB_WORKSPACE}/.github/scripts/sync-docs-with-aws.sh

- name: Build release directory (/docs/<major.minor>)
working-directory: arrow-site
if: |
!contains(needs.build.outputs.arrow-version, 'alpha') &&
!contains(needs.build.outputs.arrow-version, 'beta') &&
!contains(needs.build.outputs.arrow-version, 'rc')
!contains(needs.publish.outputs.arrow-version, 'alpha') &&
!contains(needs.publish.outputs.arrow-version, 'beta') &&
!contains(needs.publish.outputs.arrow-version, 'rc')
run: |
bundle exec jekyll build -b docs/${{ needs.build.outputs.arrow-version }} -s docs
tree _site > $BASEDIR/logs/content_docs-${{ needs.build.outputs.arrow-version }}.log
bundle exec jekyll build -b docs/${{ needs.publish.outputs.arrow-version }} -s docs
tree _site > $BASEDIR/logs/content_docs-${{ needs.publish.outputs.arrow-version }}.log

- name: Publish release directory (/docs/<major.minor>)
working-directory: arrow-site
if: |
!contains(needs.build.outputs.arrow-version, 'alpha') &&
!contains(needs.build.outputs.arrow-version, 'beta') &&
!contains(needs.build.outputs.arrow-version, 'rc')
!contains(needs.publish.outputs.arrow-version, 'alpha') &&
!contains(needs.publish.outputs.arrow-version, 'beta') &&
!contains(needs.publish.outputs.arrow-version, 'rc')
run: |
aws s3 sync _site s3://$S3_BUCKET/docs/${{ needs.build.outputs.arrow-version }} --delete --exclude "/CNAME" --exclude "/code/*" --exclude "/index.html" --exclude "/redirects.json" >> $BASEDIR/logs/aws_sync.log
aws s3 sync _site s3://$S3_BUCKET/docs/${{ needs.publish.outputs.arrow-version }} --delete --exclude "/CNAME" --exclude "/code/*" --exclude "/index.html" --exclude "/redirects.json" >> $BASEDIR/logs/aws_sync.log

- name: Build latest version (/docs/next)
working-directory: arrow-site
Expand All @@ -208,9 +215,9 @@ jobs:

- name: Publish sitemap.xml
if: |
!contains(needs.build.outputs.arrow-version, 'alpha') &&
!contains(needs.build.outputs.arrow-version, 'beta') &&
!contains(needs.build.outputs.arrow-version, 'rc')
!contains(needs.publish.outputs.arrow-version, 'alpha') &&
!contains(needs.publish.outputs.arrow-version, 'beta') &&
!contains(needs.publish.outputs.arrow-version, 'rc')
run: |
${GITHUB_WORKSPACE}/.github/scripts/create-sitemap.sh > sitemap.xml
aws s3 cp sitemap.xml s3://$S3_BUCKET/sitemap.xml >> $BASEDIR/logs/aws_sync.log
Expand Down