From a5783a9920968083ba56c60968cafda9505d9831 Mon Sep 17 00:00:00 2001 From: Aisuko Date: Thu, 21 Mar 2024 06:26:14 +0000 Subject: [PATCH] Add makefile Signed-off-by: Aisuko --- .github/workflows/ci-backend.yaml | 11 ++++++----- Makefile | 11 +++++++++++ docker-compose.yaml | 4 +--- 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 Makefile diff --git a/.github/workflows/ci-backend.yaml b/.github/workflows/ci-backend.yaml index 91b3d78..b6b18a1 100644 --- a/.github/workflows/ci-backend.yaml +++ b/.github/workflows/ci-backend.yaml @@ -2,9 +2,9 @@ name: 'Backend CI/CD 🚀' on: push: branches: - - 'feature/**' - - 'feat/**' - - 'fix/**' + - 'main' + tags: + - 'v*' pull_request: branches: - 'feature/**' @@ -169,8 +169,8 @@ jobs: name: codecov-umbrella verbose: true - docker_build: - name: 'Docker Build 🐳' + docker_operations: + name: 'Docker Build and Push🐳' needs: [build, code-quality, test] strategy: matrix: @@ -206,4 +206,5 @@ jobs: - name: Push Docker image if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() run: | + docker build -t ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//} . docker push ghcr.io/${{ secrets.DOCKER_REGISTRY }}/${{ secrets.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cc52c32 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +.PHONY: env +env: + @cp .env.example .env + +.PHONY: build +build: env + docker-compose build + +.PHONY: up +up: env build + docker-compose up -d \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 8fce9a4..9925075 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,5 +1,3 @@ -version: '3.9' - services: db: image: postgres:latest @@ -129,7 +127,7 @@ services: - "minio" frontend: - image: ghcr.io/rebel:latest + image: ghcr.io/rebel:v0.0.4 container_name: frontend restart: always expose: