-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (66 loc) · 1.97 KB
/
dev_deployment.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
name: uah dev deployment
on:
workflow_dispatch:
jobs:
unit-tests:
runs-on: ubuntu-20.04
env:
AWS_DEFAULT_REGION: us-west-2
strategy:
matrix:
python: [3.9]
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install Tox
run: pip install tox
- name: Run Tox test environment
# Run tox using the version of Python in `PATH`
run: tox -e py
dev-deployment:
strategy:
matrix:
python: [3.9]
runs-on: ubuntu-20.04
needs: [unit-tests]
environment:
name: dev
env:
AWS_DEFAULT_REGION: us-west-2
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install tox
run: pip install tox
- name: Configure awscli
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Convert to environment variables
env:
SECRETS_CONTEXT: ${{ toJson(secrets) }}
run: |
while read -rd $'' line
do
echo "$line" >> $GITHUB_ENV
done < <(jq -r <<<"$SECRETS_CONTEXT" \
'to_entries|map("\(.key)=\(.value)\u0000")[]')
- name: Deploy with tox
run: tox -e dev -r -- deploy --require-approval never
- name: Run DB setup
env:
HLS_STACKNAME: ${{ secrets.HLS_STACKNAME }}
run: |
setupdb=$(aws cloudformation describe-stacks --stack-name \
$HLS_STACKNAME --query \
"Stacks[0].Outputs[?OutputKey=='setupdbexport'].OutputValue" \
--output=text)
aws lambda invoke --function-name=$setupdb response.json