From 6cec53fa3b11d6dd5c3b61b3bf0f90240e76f2ca Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi Date: Fri, 13 Jun 2025 12:30:52 +0530 Subject: [PATCH] Fix: add postgres variables and build image workflow --- .env.example | 9 +++- .github/workflows/build-docker-image.yml | 60 ++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-docker-image.yml diff --git a/.env.example b/.env.example index 8307ae9..45d9bbf 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,12 @@ +VERSION=0.1.0 + +# POSTGRES +POSTGRES_USER=docker +POSTGRES_PASSWORD=docker +POSTGRES_DB=core + LOGIN_ORIGIN=http://localhost:3000 -DATABASE_URL="postgresql://docker:docker@postgres:5432/postgres?schema=echo" +DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?schema=echo" # This sets the URL used for direct connections to the database and should only be needed in limited circumstances # See: https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#fields:~:text=the%20shadow%20database.-,directUrl,-No diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml new file mode 100644 index 0000000..6eaa217 --- /dev/null +++ b/.github/workflows/build-docker-image.yml @@ -0,0 +1,60 @@ +name: Build Docker Images + +on: + push: + tags: + - "*" + workflow_dispatch: + +jobs: + build-webapp: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + ref: main + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Registry + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + + - name: Build and Push Frontend Docker Image + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: redplanethq/core:${{ github.ref_name }} + + build-server: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + ref: main + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Registry + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + + - name: Build and Push Server Docker Image + uses: docker/build-push-action@v2 + with: + context: . + file: apps/server/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: redplanethq/core:${{ github.ref_name }}