-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #400 from kbolashev/docs/ci
Add a GitHub Action to build and upload docs to a GCS Bucket
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Publish Docs | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: "./docs" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- name: Install client and dependencies | ||
working-directory: "./" | ||
run: | | ||
python -m pip install --upgrade pip setuptools | ||
pip install . | ||
- name: Install docs dependencies | ||
run: | | ||
pip install -r requirements-docs.txt | ||
- name: Build documentation | ||
run: make html | ||
|
||
# - name: Upload docs as artifact | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: docs | ||
# path: docs/build | ||
|
||
- name: Authenticate with Google | ||
uses: "google-github-actions/auth@v2" | ||
with: | ||
project_id: ${{ secrets.GCS_PROJECT }} | ||
credentials_json: ${{ secrets.GCS_SERVICE_ACCOUNT_ACCESS_KEY }} | ||
|
||
- name: 'Set up Cloud SDK' | ||
uses: 'google-github-actions/setup-gcloud@v2' | ||
|
||
- name: Upload to Google Cloud Storage | ||
env: | ||
UPLOAD_PATH: ${{ format('gs://{0}/docs/client', secrets.DOCS_BUCKET) }} | ||
run: gsutil -m rsync -d -r build/html $UPLOAD_PATH | ||
|
||
- name: Invalidate CDN Cache | ||
env: | ||
LOAD_BALANCER: ${{ secrets.LOAD_BALANCER_NAME }} | ||
run: gcloud compute url-maps invalidate-cdn-cache $LOAD_BALANCER --path "/docs/client/*" | ||
|
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