Use copy alias type for better UX and to fix docs #292
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: Build docs | |
on: | |
push: | |
branches: | |
- master | |
- release/2* | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
type: boolean | |
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)" | |
required: false | |
default: false | |
concurrency: | |
group: ci-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Setup Just | |
uses: extractions/setup-just@v2 | |
- name: Build docs | |
run: just build | |
- name: Deploy preview to Netlify | |
uses: nwtgck/actions-netlify@v2 | |
if: github.event_name == 'pull_request' | |
with: | |
publish-dir: ./site | |
production-deploy: false | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-message: ${{ github.event.pull_request.title }} | |
enable-commit-comment: ${{ github.event_name != 'schedule' }} | |
alias: preview-${{ github.event.number }} | |
fails-without-credentials: true | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
timeout-minutes: 5 | |
- name: Publish versioned docs | |
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/2')) | |
env: | |
PUSH_TOKEN: ${{ secrets.GH_DEPLOY_PUSH_TOKEN }} | |
run: | | |
just deploy | |
just list | |
git push https://[email protected]/${{ github.repository }} publish | |
- name: Setup tmate session for debug | |
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 45 | |
with: | |
limit-access-to-actor: true |