Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:

env:
DOTNET_VERSION: 8.0.x
PACKAGE_NAME: nanotaboada/dotnet-samples-aspnetcore-webapi

jobs:
build:
Expand Down Expand Up @@ -104,3 +105,35 @@ jobs:
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: cobertura.xml

container:
needs: coverage
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image to GHCR
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/${{ env.PACKAGE_NAME }}:latest
ghcr.io/${{ env.PACKAGE_NAME }}:main
ghcr.io/${{ env.PACKAGE_NAME }}:sha-${{ github.sha }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ docker build -t aspnetcore-app .

```bash
docker run -p 9000:9000 aspnetcore-app
```

## Credits

Expand Down
Loading