Skip to content

Commit

Permalink
Configuration: improve doc publication (#2422)
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelcarmena authored Jun 22, 2021
1 parent 31327c1 commit d1c934a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .github/scripts/publish-landing-page.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

# Reason: The root directory also has docs/, docs/next/ and docs/<major.minor>.

set -e

MAIN_CONTENT=("CNAME" "code" "css" "error.html" "fonts" "img" "index.html" "js" "redirects.json")
Expand Down
16 changes: 6 additions & 10 deletions .github/scripts/publish-latest-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@

set -e

MAIN_CONTENT=("CNAME" "code" "css" "error.html" "fonts" "img" "index.html" "js" "redirects.json")

cd _site/
for file in *; do
if [[ ! ${MAIN_CONTENT[*]} =~ "$file" ]]; then
if [ -f "$file" ]; then
echo "Copying $file ..."
aws s3 cp $file s3://$S3_BUCKET/docs/$file >> $BASEDIR/logs/aws_sync.log
continue
fi
echo "Sync $file ..."
aws s3 sync $file s3://$S3_BUCKET/docs/$file --delete >> $BASEDIR/logs/aws_sync.log
if [ -f "$file" ]; then
echo "Copying $file ..."
aws s3 cp $file s3://$S3_BUCKET/docs/$file >> $BASEDIR/logs/aws_sync.log
continue
fi
echo "Sync $file ..."
aws s3 sync $file s3://$S3_BUCKET/docs/$file --delete >> $BASEDIR/logs/aws_sync.log
done
7 changes: 5 additions & 2 deletions .github/workflows/build_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
run: ${GITHUB_WORKSPACE}/.github/scripts/set-env.sh
- name: "Show env"
run: ${GITHUB_WORKSPACE}/.github/scripts/show-env.sh
- name: "Create API doc and validate documentation"
- name: "Create API doc"
working-directory: arrow-libs
run: ./gradlew buildDoc
run: ./gradlew dokka
- name: "Validate documentation"
working-directory: arrow-site
run: ./gradlew runAnk
31 changes: 21 additions & 10 deletions .github/workflows/publish_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,46 @@ jobs:
brew install tree
bundle install --gemfile Gemfile --path vendor/bundle
- name: "Create API doc and validate documentation"
- name: "Create API doc"
working-directory: arrow-libs
run: ./gradlew buildDoc
run: ./gradlew dokka

- name: "Validate documentation"
working-directory: arrow-site
run: ./gradlew runAnk

- name: "Landing page: build"
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
working-directory: arrow-site
run: |
bundle exec jekyll build -b docs -s build/site
tree _site > $BASEDIR/logs/content_docs.log
bundle exec jekyll build -s build/site
tree _site > $BASEDIR/logs/content.log
- name: "Landing page: publish"
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
working-directory: arrow-site
run: |
echo ">>> Landing page" >> $BASEDIR/logs/aws_sync.log
${GITHUB_WORKSPACE}/.github/scripts/publish-landing-page.sh
- name: "Remove index for versions"
working-directory: arrow-site
run: rm -f build/site/index.md

- name: "Latest release: build (docs/)"
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
working-directory: arrow-site
run: |
bundle exec jekyll build -b docs -s build/site
tree _site > $BASEDIR/logs/content_docs.log
- name: "Latest release: publish (docs/)"
if: ${{ env.NEW_RELEASE_VERSION_EXISTS == '1' && github.ref == 'refs/heads/main' }}
working-directory: arrow-site
run: |
echo ">>> Latest release" >> $BASEDIR/logs/aws_sync.log
${GITHUB_WORKSPACE}/.github/scripts/publish-latest-release.sh
- name: "Remove index for versions"
working-directory: arrow-site
run: rm -f build/site/index.md

- name: "Latest release: build release directory (docs/<major.minor>)"
if: env.NEW_RELEASE_VERSION_EXISTS == '1'
working-directory: arrow-site
Expand Down
1 change: 1 addition & 0 deletions arrow-site/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
kapt "io.arrow-kt:arrow-meta:$VERSION_NAME"
}

// Ank Plugin is not applied for every library to avoid adding runtime dependencies
apply plugin: 'ank-gradle-plugin'

ank {
Expand Down

0 comments on commit d1c934a

Please sign in to comment.