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: Documentation | |
on: [push] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build Docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Set up pixi | |
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 | |
with: | |
auth-host: https://conda.prod.quantco.cloud | |
auth-conda-token: ${{ secrets.QUETZ_API_KEY }} | |
environments: docs | |
- name: Install package | |
run: pixi run -e docs postinstall | |
- name: Build docs | |
run: pixi run docs | |
- name: Upload html | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: docs/_build/html | |
upload: | |
name: Upload Docs | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Download html | |
uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
- name: Authenticate with GCP | |
uses: google-github-actions/auth@v2 | |
with: | |
workload_identity_provider: projects/610600912298/locations/global/workloadIdentityPools/doqker-devel-github-actions-pool/providers/github-actions-provider | |
service_account: [email protected] | |
token_format: access_token | |
- name: Setup gcloud | |
uses: google-github-actions/setup-gcloud@v2 | |
- name: Set ref (release) | |
if: startsWith(github.ref, 'refs/tags/') | |
run: echo "docs-path=${{ github.ref_name }}" >> $GITHUB_ENV | |
- name: Set ref (main) | |
if: github.ref == 'refs/heads/main' | |
run: echo "docs-path=latest" >> $GITHUB_ENV | |
- name: Set ref (pull_request) | |
if: startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/main' | |
run: echo "docs-path=${{ github.ref }}" >> $GITHUB_ENV | |
- name: Upload to Google Cloud Storage | |
run: gcloud storage cp -r * gs://qc-github-artifacts/${{ github.repository }}/${{ env.docs-path }}/ |