Vibe coding #207
This file contains hidden or 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: .NET | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Build and test | |
| run: dotnet test --verbosity normal FillInTheTextBot.slnx | |
| - name: Publish | |
| run: dotnet publish --configuration Release --output ./output src/FillInTheTextBot.Api/FillInTheTextBot.Api.csproj | |
| - name: Build image | |
| uses: docker/[email protected] | |
| with: | |
| tags: granstel/fillinthetextbot:latest | |
| load: true | |
| push: false | |
| context: . | |
| file: src/FillInTheTextBot.Api/Dockerfile | |
| - name: Compose | |
| uses: hoverkraft-tech/compose-action@3846bcd61da338e9eaaf83e7ed0234a12b099b72 | |
| with: | |
| compose-file: docker-compose.ci.yml | |
| up-flags: --build | |
| - name: Collect per-service logs | |
| if: always() | |
| run: | | |
| mkdir -p compose-logs | |
| for s in $(docker compose -f docker-compose.ci.yml config --services); do | |
| echo "Collecting logs for $s" | |
| docker compose -f docker-compose.ci.yml logs --no-color -t "$s" > "compose-logs/${s}.log" || true | |
| done | |
| - name: Upload per-service logs folder | |
| if: failure() | |
| uses: actions/[email protected] | |
| with: | |
| name: compose-logs | |
| path: compose-logs | |
| retention-days: 7 | |
| - name: Collect docker-compose.log | |
| if: always() | |
| run: docker compose -f docker-compose.ci.yml logs -t >> docker-compose.log || true | |
| - name: Upload docker-compose.log | |
| if: always() | |
| uses: actions/[email protected] | |
| with: | |
| name: docker-compose.log | |
| path: docker-compose.log | |
| retention-days: 7 | |
| - name: Login to Docker Hub | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Push to hub | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| uses: docker/[email protected] | |
| with: | |
| context: . | |
| tags: granstel/fillinthetextbot:latest | |
| push: true |