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 : Publish Docker Image to GHCR 
2+ 
3+ on :
4+   push :
5+     branches :
6+       - main 
7+ 
8+ jobs :
9+   build-and-publish :
10+     runs-on : ubuntu-latest 
11+     permissions :
12+       contents : read 
13+       packages : write 
14+ 
15+     steps :
16+       - name : Checkout repository 
17+         uses : actions/checkout@v4 
18+ 
19+       - name : Log in to the GitHub Container Registry 
20+         uses : docker/login-action@v3 
21+         with :
22+           registry : ghcr.io 
23+           username : ${{ github.repository_owner }} 
24+           password : ${{ secrets.GITHUB_TOKEN }} 
25+ 
26+       - name : Extract metadata (tags and labels) for Docker 
27+         id : meta 
28+         uses : docker/metadata-action@v5 
29+         with :
30+           images : ghcr.io/${{ github.repository }} 
31+ 
32+       - name : Build and push Docker image 
33+         uses : docker/build-push-action@v5 
34+         with :
35+           context : . 
36+           push : true 
37+           tags : ${{ steps.meta.outputs.tags }} 
38+           labels : ${{ steps.meta.outputs.labels }} 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments