Build all artifacts via GitHub Actions #50
Workflow file for this run
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 | |
tags: ["*"] # Triggers from tags ignore the `paths` filter: https://github.com/orgs/community/discussions/26273 | |
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/') }} | |
jobs: | |
docs: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: "1" | |
# Use a separate step for instantiation to get more fine grained timing of steps | |
- 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 }} |