-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (61 loc) · 2.08 KB
/
terraform_build.yaml
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
name: Run tests and apply terraform changes for current branch
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Test with pytest
env:
ENV: test
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_dev }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_dev }}
AWS_REGION: ${{ secrets.aws_region_dev }}
LOCALSTACK_AUTH_TOKEN: ${{ secrets.localstack_auth_token }}
PLANET_API_KEY: ${{secrets.planet_api_key }}
run: |
./scripts/test
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: tests/cobertura.xml
- name: Run CodeCOV action
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: tests/cobertura.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: false
- name: Deploy production
if: success() && github.ref == 'refs/heads/production'
env:
ENV: production
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_production }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_production }}
AWS_REGION: ${{ secrets.aws_region_production }}
run: |
./scripts/infra plan
./scripts/infra apply
- name: Deploy staging
if: success() && github.ref == 'refs/heads/staging'
env:
ENV: staging
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_staging }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_staging }}
AWS_REGION: ${{ secrets.aws_region_staging }}
run: |
./scripts/infra plan
./scripts/infra apply
- name: Deploy dev
if: success() && github.ref == 'refs/heads/dev'
env:
ENV: dev
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_dev }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_dev }}
AWS_REGION: ${{ secrets.aws_region_dev }}
run: |
./scripts/infra plan
./scripts/infra apply