invalidate doc cdn cache on deploy (#328) #190
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: Docs | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: Deployment environment | ||
type: choice | ||
options: [trunk, production] | ||
default: trunk | ||
push: | ||
branches: | ||
- trunk | ||
jobs: | ||
docs: | ||
name: Build and publish documentation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
with: | ||
lfs: true | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-west-2 | ||
- name: Configure SSH key for docs insiders setup | ||
uses: webfactory/ssh-agent@v0.8.0 | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
- name: Install Poetry | ||
run: pip install poetry==1.5.1 | ||
- name: Fetch tags to enable autoversioning | ||
run: git fetch --prune --unshallow --tags | ||
- name: Update package version to PEP 440-compliant production release tag | ||
run: poetry version $(git describe --tags --abbrev=0) | ||
- name: Install Poetry dependencies | ||
run: poetry install | ||
- name: Install docs 'insiders' dependencies | ||
run: ./docs/setup_insiders.sh | ||
- name: Publish 'kolena' documentation to trunk (S3) | ||
if: inputs.environment != 'production' | ||
run: | | ||
poetry run mkdocs build --verbose --strict --config-file mkdocs.insiders.yml | ||
aws s3 sync ./site "s3://trunk-docs.kolena.io" | ||
- name: Publish 'kolena' documentation to production (S3) | ||
if: inputs.environment == 'production' | ||
run: | | ||
Check failure on line 64 in .github/workflows/docs.yml GitHub Actions / DocsInvalid workflow file
|
||
poetry run mkdocs build --verbose --strict --config-file mkdocs.insiders.yml | ||
aws s3 sync ./site "s3://docs.kolena.io" | ||
aws cloudfront create-invalidation --no-cli-pager --distribution-id ${{ var.DOC_DISTRIBUTION_ID }} --paths "/*" | ||
env: | ||
DD_RUM_CLIENT_TOKEN: ${{ vars.DD_RUM_CLIENT_TOKEN }} | ||
DD_RUM_APPLICATION_ID: ${{ vars.DD_RUM_APPLICATION_ID }} |