Skip to content

[pre-commit.ci] pre-commit autoupdate #97

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #97

Workflow file for this run

name: Generate Documentation
on:
release:
types: [published]
push:
branches: [main]
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: python:3.9-buster
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Enchant
run: apt-get update && apt-get install -y enchant
- name: Install poetry
uses: snok/install-poetry@v1
- name: Install Dependencies
run: poetry install --only main,docs
- name: Fix Disutils
run: poetry run pip install setuptools==59.5.0
- name: Check Spelling
run: poetry run sphinx-build -W -b spelling docs build
- name: Generate HTML
run: poetry run sphinx-build -W -b html docs build
- name: Store Artifacts
uses: actions/upload-artifact@v3
with:
name: html
path: build
deploy:
name: Publish
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
needs: build
steps:
- name: Retrieve Artifacts
uses: actions/download-artifact@v3
with:
name: html
path: build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Deploy to S3
run: aws s3 sync build s3://lightkit.borchero.com --delete --acl public-read
- name: Invalidate Cloudfront
run: |
aws cloudfront create-invalidation \
--distribution-id ${AWS_CLOUDFRONT_DISTRIBUTION} --paths "/*"
env:
AWS_CLOUDFRONT_DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION }}