chore: Publish docs to arrow.apache.org #83
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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: Docs CI | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| RUST_TOOLCHAIN_VERSION: stable | |
| jobs: | |
| build: | |
| name: Build Docs | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7.0.0 | |
| - name: Cache Rust crates | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| key: test-native-${{ runner.os }}-${{ env.RUST_TOOLCHAIN_VERSION }}-${{ hashFiles('native/**/Cargo.lock') }} | |
| restore-keys: | | |
| test-native-${{ runner.os }}-${{ env.RUST_TOOLCHAIN_VERSION }} | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable | |
| with: | |
| toolchain: "${{ env.RUST_TOOLCHAIN_VERSION }}" | |
| - name: Install Erlang/OTP | |
| uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.24.0 | |
| with: | |
| otp-version: 25.1.0 | |
| rebar3-version: '3.18.0' | |
| - name: Cache Hex packages | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.cache/rebar3/hex/hexpm/packages | |
| key: ${{ runner.os }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }} | |
| restore-keys: | | |
| ${{ runner.os }}-hex- | |
| - name: Generate docs | |
| run: rebar3 ex_doc | |
| - name: Copy .asf.yaml | |
| run: cp .asf.yaml doc | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| name: docs-${{ github.sha }} | |
| path: 'doc' | |
| deploy_fork: | |
| name: Deploy to GitHub Pages on fork | |
| if: >- | |
| (github.event_name == 'push' || | |
| github.event_name == 'workflow_dispatch') && | |
| github.repository != 'apache/arrow-erlang' | |
| needs: build | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v5 | |
| with: | |
| artifact_name: docs-${{ github.sha }} | |
| asf_site: | |
| # Only deploy on a push to main | |
| if: github.ref_name == 'main' && github.event_name == 'push' && github.repository == 'apache/arrow-erlang' | |
| name: Deploy to arrow.apache.org | |
| needs: build | |
| permissions: | |
| contents: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: "asf_site" | |
| cancel-in-progress: true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Download artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: docs-${{ github.sha }} | |
| path: docs | |
| - name: Decompress artifact | |
| run: tar -xf docs/artifact.tar -C asf-site | |
| - name: Deploy to ASF | |
| uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: asf-site | |
| publish_branch: asf-site | |
| # Avoid accumulating history of in progress API jobs: https://github.com/apache/arrow-rs/issues/5908 | |
| force_orphan: true |