-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (36 loc) · 1.33 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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