Skip to content

Commit afb3ce3

Browse files
committed
improve workflow
1 parent 6a4e0e4 commit afb3ce3

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

.github/workflows/pyci.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414

15+
strategy:
16+
matrix:
17+
python-version: [3.8, 3.9]
18+
1519
steps:
1620
- uses: actions/checkout@v2
1721

18-
- name: Set up Python
22+
- name: Set up Python ${{ matrix.python-version }}
1923
uses: actions/setup-python@v2
2024
with:
21-
python-version: '3.8'
25+
python-version: ${{ matrix.python-version }}
2226

2327
- name: Install dependencies
2428
run: |
@@ -35,20 +39,22 @@ jobs:
3539
make test
3640
3741
38-
- name: Set up Docker Buildx
39-
if: ${{ github.event_name == 'push' }}
40-
uses: docker/setup-buildx-action@v1
42+
deploy:
43+
needs: build
44+
runs-on: ubuntu-latest
45+
if: ${{ github.event_name == 'push' }}
46+
47+
steps:
48+
- uses: actions/checkout@v2
49+
50+
- uses: docker/setup-buildx-action@v1
4151

42-
- name: Login to Docker Hub
43-
if: ${{ github.event_name == 'push' }}
44-
uses: docker/login-action@v1
52+
- uses: docker/login-action@v1
4553
with:
4654
username: ${{ secrets.DOCKER_USERNAME }}
4755
password: ${{ secrets.DOCKER_PASSWORD }}
4856

49-
- name: Build and push
50-
if: ${{ github.event_name == 'push' }}
51-
uses: docker/build-push-action@v2
57+
- uses: docker/build-push-action@v2
5258
with:
5359
context: .
5460
push: true

0 commit comments

Comments
 (0)