-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (58 loc) · 1.58 KB
/
deploy.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
name: Run tests and deploy automation functions
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install -r requirements-dev.txt
- name: Populate .env file
run: |
echo "${{ secrets.BAM_ENV_FILE_CONTENTS }}" > ./.env
- name: Run core tests
run: |
pip install .
pytest -vv .
working-directory: ./core
- name: Run API tests
run: |
pip install ../core
pip install -r requirements.txt
pytest -vv .
working-directory: ./app
deploy:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dev dependencies
run: |
pip install -r requirements-dev.txt
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Populate .env file for functions
run: |
echo "${{ secrets.BAM_ENV_FILE_CONTENTS }}" > ./.env
- name: Install doctl serverless plugin
run: |
doctl serverless install
- name: Connect to DigitalOcean
run: |
doctl serverless connect
- name: Deploy functions
run: make deploy-functions
working-directory: ./