-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (33 loc) · 1.22 KB
/
cd.yml
File metadata and controls
42 lines (33 loc) · 1.22 KB
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
name: CD workflow
on:
workflow_run:
workflows: ["CI workflow"]
types: [completed]
jobs:
deploy:
name: Build & Push to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & push backend
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/spring-react-backend:latest ./backend
docker push ${{ secrets.DOCKERHUB_USERNAME }}/spring-react-backend:latest
- name: Build & push frontend
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/spring-react-frontend:latest ./frontend
docker push ${{ secrets.DOCKERHUB_USERNAME }}/spring-react-frontend:latest
- name: Trigger backend deploy on Render
run: |
curl -X POST ${{ secrets.RENDER_BACKEND_DEPLOY_HOOK }}
- name: Trigger frontend deploy on Render
run: |
curl -X POST ${{ secrets.RENDER_FRONTEND_DEPLOY_HOOK }}