Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
Comment thread
Harish-Naruto marked this conversation as resolved.
with:
persist-credentials: false

- name: Log in to Docker Hub
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# Backend
- name: Build and push backend image
uses: docker/build-push-action@v6
with:
context: ./backend
file: ./docker/Dockerfile.backend
target: development
push: ${{ github.event_name == 'push' }}
tags: callofcode07/coc-admin-backend:latest

# Frontend
- name: Build and push frontend image
uses: docker/build-push-action@v6
with:
context: ./frontend
file: ./docker/Dockerfile.frontend
target: development
push: ${{ github.event_name == 'push' }}
tags: callofcode07/coc-admin-frontend:latest
# change this if using this for production
build-args: |
VITE_API_URL=https://api.yourdomain.com
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
.env.test.local
.env.production.local
.env.local
.env.local.coc-api

# caches
.eslintcache
Expand Down
Loading
Loading