From 0a39f8e29d043705398551d0567eea7b2ba0a0af Mon Sep 17 00:00:00 2001 From: Louis King Date: Sat, 7 Dec 2024 17:20:08 +0000 Subject: [PATCH] Testing --- .dockerignore | 1 + .github/workflows/docker.yml | 44 ++++++++++++++++++++++++++++++++++++ Dockerfile | 9 ++++++++ 3 files changed, 54 insertions(+) create mode 100644 .github/workflows/docker.yml create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore index 5ceb386..b64ddbc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ +lib venv diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..bb79c8a --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,44 @@ +name: Create and publish a Docker image + +on: + push: + branches: + - main + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.PAT_PACKAGES }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ea6ec29 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.10 + +COPY . /app +WORKDIR /app + +RUN python -m venv /venv && \ + python -m pip install --upgrade pip poetry && \ + poetry install +