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 : CI Pipeline
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+ workflow_dispatch :
7+
8+ env :
9+ REGISTRY : docker.io
10+ IMAGE_NAME_BACKEND : famouswealth/devops-backend
11+ IMAGE_NAME_FRONTEND : famouswealth/devops-frontend
12+
13+ jobs :
14+ build-and-push :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v3
19+
20+ - name : Log in to Docker Hub
21+ uses : docker/login-action@v2
22+ with :
23+ username : ${{ secrets.DOCKERHUB_USERNAME }}
24+ password : ${{ secrets.DOCKERHUB_TOKEN }}
25+
26+ - name : Build and push Backend image
27+ uses : docker/build-push-action@v5
28+ with :
29+ context : ./backend
30+ push : true
31+ tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BACKEND }}:latest
32+
33+ - name : Build and push Frontend image
34+ uses : docker/build-push-action@v5
35+ with :
36+ context : ./frontend
37+ push : true
38+ tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FRONTEND }}:latest
You can’t perform that action at this time.
0 commit comments