File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 branches : [ "main" ]
88
99jobs :
10-
1110 build :
12-
1311 runs-on : ubuntu-latest
12+ # Define the tag once so both steps use the exact same value
13+ env :
14+ IMAGE_TAG : ${{ github.sha }}
1415
1516 steps :
1617 - uses : actions/checkout@v4
17- - name : Build the Docker image
18- run : docker build . --file Dockerfile --tag duylongcontainer/ui:$(date +%s)
1918
19+ - name : Log in 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 the Docker image
26+ run : docker build . --file Dockerfile --tag duylongcontainer/ui:${{ env.IMAGE_TAG }}
2027
2128 - name : Push to Dockerhub
22- run : docker push duylongcontainer/ui:$(date +%s)
29+ run : docker push duylongcontainer/ui:${{ env.IMAGE_TAG }}
You can’t perform that action at this time.
0 commit comments