Skip to content

Commit 7d4f294

Browse files
committed
Publish docker
1 parent 24bf881 commit 7d4f294

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

cookiecutter.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"project_name": "Best Practices",
3-
"repo_name": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}",
4-
"docker": "y"
3+
"repo_name": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}"
54
}

hooks/post_gen_project.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,13 @@ def set_python_version():
1414
f.write(contents)
1515

1616

17-
def remove_docker():
18-
file_names = ["Dockerfile", ".dockerignore"]
19-
for file_name in file_names:
20-
if os.path.exists(file_name):
21-
os.remove(file_name)
22-
23-
2417
SUCCESS = "\x1b[1;32m"
2518
INFO = "\x1b[1;33m"
2619
TERMINATOR = "\x1b[0m"
2720

2821

2922
def main():
3023
set_python_version()
31-
32-
docker = "{{ cookiecutter.docker }}".lower() == "y"
33-
34-
if not docker:
35-
remove_docker()
36-
3724
print(SUCCESS + "Project successfully initialized" + TERMINATOR)
3825

3926

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Publish docker image
2+
3+
on:
4+
push:
5+
tags: "*"
6+
7+
jobs:
8+
docker:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Publish to GitHub packages
14+
uses: whoan/docker-build-with-cache-action@v2
15+
with:
16+
registry: docker.pkg.github.com
17+
username: ${{ "{{ github.actor }}" }}
18+
password: ${{ "{{ secrets.GITHUB_TOKEN }}" }}
19+
image_name: ${{ "{{ github.repository }}" }}/{{cookiecutter.repo_name}}

0 commit comments

Comments
 (0)