File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-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 : [ main ]
6+
7+ jobs :
8+ build-and-push :
9+ runs-on : ubuntu-latest
10+ permissions :
11+ contents : read
12+ packages : write
13+
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v4
17+ with :
18+ fetch-depth : 0 # Saves time by not fetching other branches
19+
20+ - name : Set up Docker Buildx
21+ uses : docker/setup-buildx-action@v3
22+
23+ - name : Login to GitHub Container Registry
24+ uses : docker/login-action@v3
25+ with :
26+ registry : ghcr.io
27+ username : ${{ github.repository_owner }}
28+ password : ${{ secrets.GITHUB_TOKEN }}
29+
30+ - name : Build and push Docker image
31+ id : docker_build
32+ uses : docker/build-push-action@v6
33+ with :
34+ context : .
35+ push : true
36+ tags : ghcr.io/${{ github.repository }}:latest
37+ cache-from : type=gha
38+ cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments