File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed
Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change 1- name : Docker Image CI
1+ name : Docker Build and Push
22
33on :
44 push :
5- branches : [ "main" ]
6- pull_request :
7- branches : [ "main" ]
5+ branches : [ main ]
86
97jobs :
10-
118 build :
12-
139 runs-on : ubuntu-latest
14-
1510 steps :
16- - uses : actions/checkout@v4
17- - name : Build the Docker image
18- run : docker build . --file Dockerfile --tag my-image-name:$(date +%s)
11+ - uses : actions/checkout@v4
12+ - name : Log in to GitHub Container Registry
13+ uses : docker/login-action@v3
14+ with :
15+ registry : ghcr.io
16+ username : ${{ github.actor }}
17+ password : ${{ secrets.GITHUB_TOKEN }}
18+ - name : Build and push Docker image
19+ uses : docker/build-push-action@v4
20+ with :
21+ context : .
22+ push : true
23+ tags : |
24+ ghcr.io/${{ github.repository }}:latest
25+ ghcr.io/${{ github.repository }}:${{ github.sha }}
You can’t perform that action at this time.
0 commit comments