Skip to content

Commit c6c29b5

Browse files
committed
feat(ci): update workflow to build and publish Docker image to GHCR
1 parent 918c820 commit c6c29b5

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/dotnet.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,35 @@ jobs:
104104
with:
105105
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
106106
coverage-reports: cobertura.xml
107+
108+
container:
109+
needs: coverage
110+
runs-on: ubuntu-latest
111+
112+
permissions:
113+
contents: read
114+
packages: write
115+
116+
steps:
117+
- name: Checkout repository
118+
uses: actions/checkout@v4
119+
120+
- name: Log in to GitHub Container Registry
121+
uses: docker/login-action@v3
122+
with:
123+
registry: ghcr.io
124+
username: ${{ github.actor }}
125+
password: ${{ secrets.GITHUB_TOKEN }}
126+
127+
- name: Set up Docker Buildx
128+
uses: docker/setup-buildx-action@v3
129+
130+
- name: Build and push Docker image to GHCR
131+
uses: docker/build-push-action@v5
132+
with:
133+
context: .
134+
push: true
135+
tags: |
136+
ghcr.io/${{ github.repository }}:latest
137+
ghcr.io/${{ github.repository }}:main
138+
ghcr.io/${{ github.repository }}:sha-${{ github.sha }}

0 commit comments

Comments
 (0)