File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main
7- pull_request :
7+ workflow_dispatch :
88
99jobs :
10- build :
10+ docker-publish :
1111 runs-on : ubuntu-latest
1212
1313 steps :
@@ -17,26 +17,17 @@ jobs:
1717 - name : Set up Docker Buildx
1818 uses : docker/setup-buildx-action@v2
1919
20- - name : Build Docker image
21- run : |
22- docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }} .
23-
24- push :
25- runs-on : ubuntu-latest
26- needs : build
27- if : github.ref == 'refs/heads/main'
28-
29- steps :
30- - name : Checkout code
31- uses : actions/checkout@v4
32-
3320 - name : Log in to GitHub Container Registry
3421 uses : docker/login-action@v2
3522 with :
3623 registry : ghcr.io
3724 username : ${{ github.actor }}
3825 password : ${{ secrets.GITHUB_TOKEN }}
3926
27+ - name : Build Docker image
28+ run : |
29+ docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }} .
30+
4031 - name : Push Docker image
4132 run : |
4233 docker push ghcr.io/${{ github.repository }}:${{ github.sha }}
You can’t perform that action at this time.
0 commit comments