Skip to content

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Load .env file
run: |
echo "PERSONAL_ACCESS_TOKEN_GITHUB=${{ secrets.PERSONAL_ACCESS_TOKEN_GITHUB }}" >> .env
echo "gemini_key=${{ secrets.gemini_key }}" >> .env
cat .env # Print the contents of the .env file for debugging
# Log in to Docker Hub
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
# Backend
- name: Build backend Docker image
run: |
cd backend
docker build --build-arg PERSONAL_ACCESS_TOKEN_GITHUB=${{ secrets.PERSONAL_ACCESS_TOKEN_GITHUB }} --build-arg gemini_key=${{ secrets.gemini_key }} -t musawar96/devopsgenie:backend-latest .
- name: Push backend Docker image
run: |
docker push musawar96/devopsgenie:backend-latest
# Frontend
- name: Build frontend Docker image
run: |
cd frontend
docker build -t musawar96/devopsgenie:frontend-latest .
- name: Push frontend Docker image
run: |
docker push musawar96/devopsgenie:frontend-latest