File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CD workflow
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+
7+ jobs :
8+ deploy :
9+ name : Build & Push to Docker Hub
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v3
15+
16+ - name : Set up Docker Buildx
17+ uses : docker/setup-buildx-action@v2
18+
19+ - name : Login to Docker Hub
20+ uses : docker/login-action@v3
21+ with :
22+ username : ${{ secrets.DOCKERHUB_USERNAME }}
23+ password : ${{ secrets.DOCKERHUB_TOKEN }}
24+
25+ - name : Build & push backend
26+ run : |
27+ docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/spring-react-backend:latest ./backend
28+ docker push ${{ secrets.DOCKERHUB_USERNAME }}/spring-react-backend:latest
29+
30+ - name : Build & push frontend
31+ run : |
32+ docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/spring-react-frontend:latest ./frontend
33+ docker push ${{ secrets.DOCKERHUB_USERNAME }}/spring-react-frontend:latest
You can’t perform that action at this time.
0 commit comments