Skip to content

Commit cf63170

Browse files
committed
👷
1 parent efe8354 commit cf63170

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/python-app.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests, formatting and lint with a single version of Python
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: tests
4+
name: Python CI/CD
55

66
on:
77
push:
@@ -10,7 +10,7 @@ on:
1010
branches: [ master ]
1111

1212
jobs:
13-
build:
13+
ci:
1414

1515
runs-on: ubuntu-latest
1616

@@ -20,20 +20,39 @@ jobs:
2020
uses: actions/setup-python@v2
2121
with:
2222
python-version: 3.6.13
23+
2324
- name: Install dependencies
2425
run: |
2526
python -m pip install --upgrade pip
2627
pip install flake8 pytest
2728
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29+
2830
- name: Lint with flake8
2931
run: |
3032
# stop the build if there are Python syntax errors or undefined names
3133
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
3234
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3335
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
36+
3437
- name: Format with black
3538
run: |
3639
black .
3740
- name: Test with pytest
3841
run: |
3942
pytest
43+
44+
build-push-image:
45+
name: Build docker image and push
46+
needs: ci
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Simple echo placeholder for building/pushing image
50+
run: echo "I built and pushed the Docker image to your image registry"
51+
52+
deploy:
53+
name: Deploy Python web app to <YOUR CLOUD PROVIDER>
54+
needs: build-push-image
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Simple echo placeholder for now
58+
run: echo "deployed to <YOUR CLOUD PROVIDER>!"

0 commit comments

Comments
 (0)