-
Notifications
You must be signed in to change notification settings - Fork 252
30 lines (28 loc) · 959 Bytes
/
docs.prod.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
name: Build and deploy docs
on:
push:
branches: [ prod ]
jobs:
build-docs:
runs-on: ubuntu-latest
if: github.repository == 'pschlan/cron-job.org'
environment:
name: prod
url: https://docs.cron-job.org
steps:
- uses: actions/checkout@v2
- uses: ammaraskar/sphinx-action@master
with:
pre-build-command: 'pip install sphinx_rtd_theme'
docs-folder: 'docs/'
- name: Deploy to S3/CloudFront
run: |
aws s3 sync ./build/html/ s3://$DOCS_S3_BUCKET
aws cloudfront create-invalidation --distribution-id $DOCS_CF_DISTRIBUTION_ID --paths "/*"
working-directory: ./docs
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-west-1
DOCS_S3_BUCKET: ${{ secrets.DOCS_S3_BUCKET }}
DOCS_CF_DISTRIBUTION_ID: ${{ secrets.DOCS_CF_DISTRIBUTION_ID }}