From 806cf587a92e10075749a773644482563ff3eea8 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Sun, 5 Oct 2025 10:00:53 -0400 Subject: [PATCH] Add github action to build and publish docker image --- .github/workflows/build.yaml | 30 ++++++++++++++++++++++++++++++ docker/Dockerfile | 2 +- requirements.server.txt | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..05ee82e7 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,30 @@ +name: Build Docker image + +on: + push: + branches: ['main'] + +jobs: + build: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + id-token: write + + steps: + - uses: actions/checkout@v5 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6 + with: + context: docker + push: true + tags: ghcr.io/${{github.repository}}:latest diff --git a/docker/Dockerfile b/docker/Dockerfile index 44f9c3f8..3537e12c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7-alpine +FROM python:3.10-alpine RUN apk update \ && apk add --no-cache --virtual .build-deps git g++ postgresql-dev yaml-dev \ diff --git a/requirements.server.txt b/requirements.server.txt index 24853b1a..1cdfc0a0 100644 --- a/requirements.server.txt +++ b/requirements.server.txt @@ -1,5 +1,5 @@ # These requirements are what you would install on a production server. . -psycopg2==2.8 +psycopg2==2.9.10 gunicorn==19.9.0 progressbar2