-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.61 KB
/
deployDev.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
48
49
50
51
52
53
name: Build and deploy MERN stack
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
aws-access-key-id: ${{ secrets.AWS_SECRET_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t hellopradum/backend-wanderlust backend/.
docker build -t hellopradum/frontend-wanderlust frontend/.
docker push hellopradum/backend-wanderlust:latest
docker push hellopradum/frontend-wanderlust:latest
- name: Update kubeconfig
run: aws eks update-kubeconfig --name demo-ekscluster
- name: Create and claim persistent volume
run: |
kubectl apply -f kubernetes/persistentVolume.yaml
kubectl apply -f kubernetes/persistentVolumeClaim.yaml
- name: Deploy MongoDB
run: |
kubectl apply -f kubernetes/mongodb.yaml
- name: Deploy Redis
run: |
kubectl apply -f kubernetes/redis.yaml
- name: Deploy Backend
run: |
kubectl apply -f kubernetes/backend.yaml
- name: Deploy Frontend
run: |
kubectl apply -f kubernetes/frontend.yaml