Skip to content

Commit 5009999

Browse files
committed
Build and push to GHCR
1 parent f7ec6e7 commit 5009999

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/maven.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,23 @@ jobs:
5252
5353
- name: Show container logs
5454
run: docker logs -f my-app-container
55+
56+
- name: Remove container
57+
run: docker container rm -f my-app-container
58+
59+
- name: Log in to GitHub Container Registry
60+
uses: docker/login-action@v2
61+
with:
62+
registry: ghcr.io
63+
username: ${{ github.actor }}
64+
password: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- name: Build and push to GHCR
67+
uses: docker/build-push-action@v4
68+
with:
69+
context: dockerfile
70+
file: dockerfile/Dockerfile
71+
push: true
72+
tags: |
73+
ghcr.io/${{ github.repository_owner }}/my-app-image:latest
74+
ghcr.io/${{ github.repository_owner }}/my-app-image:${{ github.sha }}

0 commit comments

Comments
 (0)