-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.28 KB
/
Copy pathpytest.yml
File metadata and controls
44 lines (36 loc) · 1.28 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
name: Python test
on:
push:
branches: [main]
paths-ignore:
- ReadMe.md
jobs:
linter-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4 # Correct action for checking out the repository
- name: Set Up Python 3.11
uses: actions/setup-python@v5 # Correct action for setting up Python
with:
python-version: '3.11.6'
cache: 'pip'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
run: |
python test_task.py
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: Build and Push Docker image
env:
REPOSITORY: pythontest
IMAGE_TAG: v4.1.0
run: |
docker build -t ${{secrets.DOCKERHUB_USERNAME}}/$REPOSITORY:$IMAGE_TAG .
docker push ${{secrets.DOCKERHUB_USERNAME}}/$REPOSITORY:$IMAGE_TAG