Update CleanAspire.Api.csproj #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push Docker Image | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get next version | |
uses: reecetech/[email protected] | |
id: version | |
with: | |
scheme: semver | |
increment: patch | |
- run: git tag ${{ steps.version.outputs.version }} | |
- run: git push origin ${{ steps.version.outputs.version }} | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.0.x' | |
# - name: Restore dependencies | |
# run: dotnet restore CleanAspire.sln | |
# - name: Build | |
# run: dotnet build CleanAspire.sln --no-restore | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Publish Docker image using .NET SDK | |
run: | | |
dotnet publish --os linux --arch x64 "src/CleanAspire.AppHost/CleanAspire.AppHost.csproj" -c Release /p:PublishProfile=DefaultContainer /p:ContainerRepository=${{ secrets.DOCKER_USERNAME }}/cleanaspire /p:ContainerTag=${{ steps.version.outputs.version }} | |
- name: Push Docker image to Docker Hub | |
run: | | |
docker push ${{ secrets.DOCKER_USERNAME }}/cleanaspire:${{ steps.version.outputs.version }} |