File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 4242 - name : Checkout the source code
4343 uses : actions/checkout@v4
4444
45- - name : Build the Docker image
46- run : docker build -t ghcr.io/${{ github.repository }}/${{ matrix.image }}:latest ${{ matrix.image }}/
47-
4845 - name : Authenticate with GitHub Container Registry
4946 uses : docker/login-action@v3
5047 with :
5350 password : ${{ secrets.GITHUB_TOKEN }}
5451 if : github.event_name == 'push' && github.ref == 'refs/heads/master'
5552
56- - name : Upload the Docker image to GitHub Container Registry
57- run : docker push ghcr.io/${{ github.repository }}/${{ matrix.image }}:latest
58- if : github.event_name == 'push' && github.ref == 'refs/heads/master'
53+ - name : Build and push
54+ uses : docker/build-push-action@v6
55+ with :
56+ context : ${{ matrix.image }}/
57+ push : github.event_name == 'push' && github.ref == 'refs/heads/master'
58+ tags : |
59+ ghcr.io/${{ github.repository }}/${{ matrix.image }}:latest
60+ ghcr.io/${{ github.repository }}/${{ matrix.image }}:${{ github.sha }}
You can’t perform that action at this time.
0 commit comments