Fix pre-built installation instructions (#248) #127
This file contains 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
name: Documenter | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- released | |
paths: | |
- "docs/**" | |
- ".github/workflows/Documenter.yml" | |
pull_request: | |
paths: | |
- "docs/**" | |
- ".github/workflows/Documenter.yml" | |
concurrency: | |
# Skip intermediate builds: always. | |
# Cancel intermediate builds: only if it is a pull request build. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
env: | |
build_dir: ./build | |
jobs: | |
docs: | |
if: github.event_name == 'release' && github.event.action == 'published' | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: "1" | |
- name: Restore build cache | |
uses: actions/cache/restore@v3 | |
id: build-cache | |
with: | |
key: build-cache.ray-jl.documenter | |
path: ~/.cache | |
# Use a separate step for instantiation to get more fine grained timing of steps | |
- name: Build ray_julia library | |
id: ray_julia | |
shell: julia --color=yes --project {0} | |
run: | | |
using Pkg | |
Pkg.instantiate() | |
include(joinpath(pwd(), "build_library.jl")) | |
build_library(; override=true) | |
working-directory: ${{ env.build_dir }} | |
- name: Configure doc environment | |
shell: julia --project=docs --color=yes {0} | |
run: | | |
using Pkg | |
Pkg.develop(PackageSpec(path=pwd())) | |
Pkg.instantiate() | |
- uses: julia-actions/julia-buildpkg@v1 | |
- uses: julia-actions/julia-docdeploy@v1 | |
with: | |
install-package: false # Avoid instantiating twice | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # Used when run by tagbot | |
- name: Preview URL | |
if: ${{ github.event_name == 'pull_request' }} | |
run: | | |
repo_name="${repo#*/}" | |
repo_owner="${repo%/*}" | |
echo "Documentation preview available at:" | tee -a "$GITHUB_STEP_SUMMARY" | |
echo "https://${repo_owner}.github.io/${repo_name}/previews/PR${PR}" | tee -a "$GITHUB_STEP_SUMMARY" | |
env: | |
repo: ${{ github.repository }} | |
PR: ${{ github.event.number }} | |
# https://github.com/actions/cache/tree/main/save#always-save-cache | |
- name: Save build cache | |
uses: actions/cache/save@v3 | |
if: always() && steps.build-cache.outputs.cache-hit != 'true' | |
with: | |
key: ${{ steps.build-cache.outputs.cache-primary-key }} | |
path: ~/.cache |