-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (63 loc) · 1.69 KB
/
deploy-archives-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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Deploy Archives Docs
on:
pull_request:
paths:
- "archives/**"
push:
branches:
- main
paths:
- "archives/**"
workflow_dispatch: {}
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "pip"
# No venv here: caching is easier, the environment is ephemeral anyway.
- name: Install dependencies
run: |
cd archives
pip install -r requirements.txt
- name: Build Archive Docs
run: |
cd archives
mkdocs build
# Combine with index redirect page
mkdir site
mv dist site/docs
cp index.html site/
- uses: actions/upload-artifact@v3
with:
name: archives-docs
path: archives/site/
deploy:
if: github.ref == 'refs/heads/main'
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: archives-docs
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.ARCHIVE_DOCS_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ARCHIVE_DOCS_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Copy files to S3
env:
ARCHIVE_BUCKET: univaf-data-snapshots
run: |
aws s3 cp index.html "s3://${ARCHIVE_BUCKET}/index.html"
aws s3 sync docs "s3://${ARCHIVE_BUCKET}/docs/"