-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (61 loc) · 2.12 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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: sa-github-actions@doqker-devel.iam.gserviceaccount.com
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 }}/