From 25a5fbfa9bf93e1ab0595264a8a79ae5bd8edd41 Mon Sep 17 00:00:00 2001 From: Michael Kotten Date: Fri, 3 Jun 2022 08:08:04 +0200 Subject: [PATCH 1/3] installs build tools for arm support --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index d7de0b2..ba9408e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM python:3-slim +RUN apt-get update && apt-get install -y build-essential python3-dev && rm -rf /var/lib/apt/lists/* + RUN useradd sungather WORKDIR /usr/src/sungather From a55bdb3bcbb758e8c0f22343e7ab69b643d56279 Mon Sep 17 00:00:00 2001 From: Michael Kotten Date: Wed, 8 Jun 2022 08:08:39 +0200 Subject: [PATCH 2/3] adds github action to build and push docker image --- .github/workflows/docker-image.yml | 40 +++++++++++++++++++++--------- .gitignore | 4 +++ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 2c0da9b..324d79e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,17 +2,33 @@ name: Docker Image CI on: push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - + branches: + - main jobs: - - build: - - runs-on: python:3-slim - + docker: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag sungather:$(date +%s) + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/sungather:latest diff --git a/.gitignore b/.gitignore index b77924e..cd33ed3 100644 --- a/.gitignore +++ b/.gitignore @@ -115,3 +115,7 @@ dmypy.json # Pyre type checker .pyre/ + +# Intellij IDEA +.idea +*.iml \ No newline at end of file From 35c65cb86d942f4508b4e907475905752c7f939e Mon Sep 17 00:00:00 2001 From: Michael Kotten Date: Wed, 27 Jul 2022 09:44:01 +0200 Subject: [PATCH 3/3] adds current version as tag for docker push --- .github/workflows/docker-image.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 324d79e..4fb1d85 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -6,18 +6,17 @@ on: - main jobs: docker: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.x' - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + run: echo "::set-output name=tag::v$(python setup.py --version)" + id: version + - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 @@ -31,4 +30,4 @@ jobs: context: . platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/sungather:latest + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/sungather:${{ steps.version.outputs.tag }},${{ secrets.DOCKERHUB_USERNAME }}/sungather:latest