Skip to content

Commit c276be7

Browse files
authored
Merge pull request #3 from SAnCherepan/develop
Added execution via docker
2 parents 57d693f + a12a8a5 commit c276be7

5 files changed

Lines changed: 66 additions & 9 deletions

File tree

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
.github
3+
venv
4+
dist
5+
**/*.egg-info

.github/workflows/release.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- name: Checkout
17+
uses: actions/checkout@v3
1718

1819
- name: Set up Python
1920
uses: actions/setup-python@v3
@@ -35,4 +36,37 @@ jobs:
3536
with:
3637
user: __token__
3738
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
38-
repository_url: https://test.pypi.org/legacy/
39+
repository_url: https://test.pypi.org/legacy/
40+
41+
deploy-docker:
42+
runs-on: ubuntu-latest
43+
if: github.ref_type == 'tag'
44+
45+
needs: deploy-pypi
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v3
49+
50+
- name: Login to Docker Hub
51+
uses: docker/login-action@v2
52+
with:
53+
username: ${{ secrets.DOCKER_USER }}
54+
password: ${{ secrets.DOCKER_TOKEN }}
55+
56+
- name: Extract metadata (tags, labels) for Docker
57+
id: meta
58+
uses: docker/metadata-action@v4
59+
with:
60+
images: sancherepan/repo-reader
61+
flavor: latest=true
62+
tags: type=semver,pattern={{version}}
63+
64+
65+
- name: Build and push
66+
uses: docker/build-push-action@v3
67+
with:
68+
context: .
69+
file: docker/Dockerfile
70+
push: true
71+
tags: ${{ steps.meta.outputs.tags }}
72+
labels: ${{ steps.meta.outputs.labels }}

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ This is a simple example package that can be used to get basic info on GitHub re
44

55
# Installation
66

7-
Install the python package:
8-
```
7+
Python package:
8+
```commandline
99
python -m pip install --index-url https://test.pypi.org/simple/ repo_reader_sancherepan
1010
```
1111

12+
Docker image:
13+
```commandline
14+
docker pull sancherepan/repo-reader
15+
docker run -it --rm sancherepan/repo-reader read-repos --help
16+
```
1217

1318
# Usage
1419

@@ -24,3 +29,8 @@ In command line:
2429
```commandline
2530
read-repos your_github_auth_token github_repo_group_name
2631
```
32+
33+
In docker:
34+
```commandline
35+
docker run -it --rm sancherepan/repo-reader read-repos your_github_auth_token github_repo_group_name
36+
```

docker/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
# ToDo: write Dockerfile
1+
FROM python:3.11
2+
3+
COPY . /src
4+
5+
RUN pip install /src && rm -rf /src
6+
7+
CMD ["read-repos", "-h"]

pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "repo_reader_sancherepan"
7-
version = "0.2.1"
7+
version = "0.3.0"
88
authors = [
99
{ name="SAnCherepan", email="sivkinpunk@gmail.com" },
1010
]
@@ -15,12 +15,14 @@ requires-python = ">=3.11"
1515
classifiers = [
1616
"Development Status :: 2 - Pre-Alpha",
1717
"Programming Language :: Python :: 3.11",
18-
"License :: OSI Approved :: MIT License",
19-
"Operating System :: OS Independent",
18+
"License :: OSI Approved :: MIT License"
19+
]
20+
dependencies = [
21+
"requests"
2022
]
2123

2224
[project.urls]
2325
"Homepage" = "https://github.com/sancherepan/test-code"
2426

2527
[project.scripts]
26-
read-repos = "repo_reader_sancherepan.print_repos_info:main"
28+
read-repos = "repo_reader_sancherepan.print_repos_info:main"

0 commit comments

Comments
 (0)