-
Notifications
You must be signed in to change notification settings - Fork 24
53 lines (47 loc) · 1.39 KB
/
Copy pathpython-package.yml
File metadata and controls
53 lines (47 loc) · 1.39 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
name: Python package
on:
push:
branches: [ master ]
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest]
python-version: [3.7]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r req.txt
- name: Test with pytest
run: |
pytest test.py
- name: Check docker installed or not
run: docker run hello-world
- name: Push to docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: psrv3/devopswithpy
tag_with_ref: true
- name: Login to Heroku Container registry
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login
- name: Build and push
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:push -a ${{ secrets.HEROKU_APP_NAME }} web
- name: Release
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: |
heroku container:release -a ${{ secrets.HEROKU_APP_NAME }} web
sleep 50