-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (40 loc) · 1.08 KB
/
deploy.yml
File metadata and controls
52 lines (40 loc) · 1.08 KB
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
name: Publish to S3
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Poetry
run: |
pipx install poetry
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
- name: Build docs
run: |
poetry run mkdocs build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::201893381538:role/GitHubRole
role-session-name: GitHubActionsSession
- name: Upload to S3
run: |
aws s3 sync --delete ./site s3://pytest-lambda-workshop/
aws cloudfront create-invalidation --distribution-id $CF_DISTRIBUTION_ID --paths "/*"
env:
CF_DISTRIBUTION_ID: ${{ vars.CF_DISTRIBUTION_ID }}