File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Docker Image CI
2+
3+ on :
4+ push :
5+ branches : [ "master" ]
6+ pull_request :
7+ branches : [ "master" ]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ # Step 1 — Checkout code
15+ - name : Checkout Repository
16+ uses : actions/checkout@v4
17+
18+ # Step 2 — Login to DockerHub
19+ - name : Login to DockerHub
20+ uses : docker/login-action@v3
21+ with :
22+ username : ${{ secrets.DOCKERHUB_USERNAME }}
23+ password : ${{ secrets.DOCKERHUB_TOKEN }}
24+
25+ # Step 3 — Setup Buildx (for caching + multi-platform)
26+ - name : Set up Docker Buildx
27+ uses : docker/setup-buildx-action@v3
28+
29+ # Step 4 — Build and Push
30+ - name : Build & Push Docker Image
31+ uses : docker/build-push-action@v6
32+ with :
33+ context : .
34+ file : ./Dockerfile
35+ push : true
36+ platforms : linux/amd64
37+ tags : |
38+ ${{ secrets.DOCKERHUB_USERNAME }}/streamvision:latest
39+ ${{ secrets.DOCKERHUB_USERNAME }}/streamvision:${{ github.run_number }}
40+ cache-from : type=gha
41+ cache-to : type=gha,mode=max
42+
43+ # (Optional) Step 5 — Output final image tag
44+ - name : Show Image Tag
45+ run : echo "Pushed version: ${{ secrets.DOCKERHUB_USERNAME }}/streamvision:${{ github.run_number }}"
You can’t perform that action at this time.
0 commit comments