Skip to content

Commit

Permalink
Merge pull request #59 from AndrewSergienko/2.x/docker-workflow
Browse files Browse the repository at this point in the history
feature: add dockerfile and docker deploy workflow
  • Loading branch information
andiserg authored Mar 17, 2024
2 parents 5bad4e7 + 3456cf2 commit 397b84d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tests
.github
.venv
costy.egg-info
35 changes: 35 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: DockerDeploy

on:
push:
branches:
- 2.x/main
workflow_run:
workflows: ["tests"]
types:
- completed

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/costy:latest
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.11.8-slim

ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1

WORKDIR /app
COPY . ./

RUN pip install -e . --default-timeout=100

0 comments on commit 397b84d

Please sign in to comment.