forked from mattharley/pythonwa
-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (60 loc) · 1.87 KB
/
aws.yml
File metadata and controls
61 lines (60 loc) · 1.87 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
51
52
53
54
55
56
57
58
59
60
61
name: Deploy CDK Project
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- closed
jobs:
deployment:
if: (github.event.pull_request.merged == true && github.ref == 'refs/heads/main') || github.event_name == 'push'
runs-on: ubuntu-latest
environment: PythonWA AWS
steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: npm install
working-directory: ./frontend
run: npm install
- name: npm build
working-directory: ./frontend
run: npm run build
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: pip
- name: Install pipenv
run: pip install pipenv
- name: pipenv to requirements.txt
run: pipenv requirements > infrastructure/requirements.txt
- name: cdk diff
uses: youyo/aws-cdk-github-actions@v2
with:
cdk_subcommand: 'diff'
cdk_stack: '--all'
working_dir: './infrastructure'
actions_comment: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYTHON_WA_API_KEY: ${{ secrets.PYTHON_WA_API_KEY }}
- name: deploy
uses: youyo/aws-cdk-github-actions@v2
with:
cdk_subcommand: 'deploy'
cdk_stack: '--all'
cdk_args: '--require-approval never'
working_dir: './infrastructure'
actions_comment: false
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
PYTHON_WA_API_KEY: ${{ secrets.PYTHON_WA_API_KEY }}