-
-
Notifications
You must be signed in to change notification settings - Fork 8
57 lines (48 loc) · 1.56 KB
/
main.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
name: S3/CloudFront deployment docs.carpentries.org
on:
push:
branches: main
schedule:
- cron: '30 */6 * * *'
workflow_dispatch:
jobs:
build-website:
if: github.repository_owner == 'carpentries'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
- name: Install Sphinx
run: |
pip install sphinx sphinx_design myst-parser pydata-sphinx-theme
# - name: Build site
# uses: ammaraskar/sphinx-action@master
# with:
# docs-folder: "source/"
- name: Install Requirements
run: pip install -r requirements.txt
- name: Build Documentation
run: make html
- name: List Built Files
run: ls "$GITHUB_WORKSPACE/build/html"
- name: Deploy to AWS S3
id: deploy
uses: fmichonneau/s3-sync-action@log-output
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: build/html/
- name: Invalidate CloudFront
uses: chetan/invalidate-cloudfront-action@master
env:
PATHS: /*
AWS_REGION: 'us-east-1'
DISTRIBUTION: ${{ secrets.DISTRIBUTION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}