-
Notifications
You must be signed in to change notification settings - Fork 13
61 lines (59 loc) · 1.8 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
name: Generate Documentation
on:
release:
types: [published]
push:
branches: [main]
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: python:3.8-buster
steps:
- name: Checkout
uses: actions/checkout@v3
- 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://pycave.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 }}