-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (42 loc) · 1.05 KB
/
test_and_deploy.yml
File metadata and controls
53 lines (42 loc) · 1.05 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
name: test_and_deploy
on:
push:
branches:
- master
tags:
- '**'
pull_request: {}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: set up python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: install dependencies
run: pip install -r requirements.txt
- name: test
run: pytest --cov=postcode.py
- name: codecov
run: bash <(curl -s https://codecov.io/bash)
env:
CODECOV_TOKEN: '9034e2be-fde0-4017-802d-5659afeed048'
deploy:
needs:
- test
if: "success() && startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_APP: uk-postcode-api
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git switch master
- run: git remote add heroku https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP.git
- run: git push heroku master