From 0dc32f063d5da161fc200ff34e600f3f89534135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hubert=20Bry=C5=82kowski?= Date: Sun, 9 Jul 2023 15:36:04 +0200 Subject: [PATCH] add action for building docker --- .github/workflows/build_docker.yml | 46 ++++++++++++++++++++++++++++++ Dockerfile | 13 +++++++++ readme.md | 0 3 files changed, 59 insertions(+) create mode 100644 .github/workflows/build_docker.yml create mode 100644 Dockerfile create mode 100644 readme.md diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml new file mode 100644 index 0000000..5b90237 --- /dev/null +++ b/.github/workflows/build_docker.yml @@ -0,0 +1,46 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# GitHub recommends pinning actions to a commit SHA. +# To get a newer version, you will need to update the SHA. +# You can also reference a tag or branch, but the action may change without warning. + +name: Publish Docker image + +on: + release: + types: [published] + +jobs: + push_to_registries: + name: Push Docker image to multiple registries + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ghcr.io/${{ github.repository }} + + - name: Build and push Docker images + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d8ebb90 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.11 + +RUN mkdir /app COPY /app /app +COPY pyproject.toml poetry.lock /app/ + +WORKDIR /app + +ENV PYTHONPATH=${PYTHONPATH}:${PWD} +RUN pip install poetry + +RUN poetry config virtualenvs.create false +RUN poetry install --no-dev + diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..e69de29