forked from migumax/cd_example
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 1.04 KB
/
python-publish.yml
File metadata and controls
42 lines (34 loc) · 1.04 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
name: Python Package
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v3
- name: Initialize Python 3.8
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Check docker installed or not
run: docker run hello-world
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} # Docker Hub access token
- name: Push to docker hub
uses: docker/build-push-action/@v4
with:
push: true
tags: ${{secrets.DOCKERHUB_REPO}}:latest