File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1414
1515env :
1616 DOTNET_VERSION : 8.0.x
17+ PACKAGE_NAME : nanotaboada/dotnet-samples-aspnetcore-webapi
1718
1819jobs :
1920 build :
@@ -104,3 +105,35 @@ jobs:
104105 with :
105106 project-token : ${{ secrets.CODACY_PROJECT_TOKEN }}
106107 coverage-reports : cobertura.xml
108+
109+ container :
110+ needs : coverage
111+ runs-on : ubuntu-latest
112+
113+ permissions :
114+ contents : read
115+ packages : write
116+
117+ steps :
118+ - name : Checkout repository
119+ uses : actions/checkout@v4
120+
121+ - name : Log in to GitHub Container Registry
122+ uses : docker/login-action@v3
123+ with :
124+ registry : ghcr.io
125+ username : ${{ github.actor }}
126+ password : ${{ secrets.GITHUB_TOKEN }}
127+
128+ - name : Set up Docker Buildx
129+ uses : docker/setup-buildx-action@v3
130+
131+ - name : Build and push Docker image to GHCR
132+ uses : docker/build-push-action@v5
133+ with :
134+ context : .
135+ push : true
136+ tags : |
137+ ghcr.io/${{ env.PACKAGE_NAME }}:latest
138+ ghcr.io/${{ env.PACKAGE_NAME }}:main
139+ ghcr.io/${{ env.PACKAGE_NAME }}:sha-${{ github.sha }}
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ docker build -t aspnetcore-app .
4848
4949``` bash
5050docker run -p 9000:9000 aspnetcore-app
51+ ```
5152
5253## Credits
5354
You can’t perform that action at this time.
0 commit comments