Remove dev in runtime #25
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: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: read | |
| packages: write | |
| # se futuramente for usar ambientes/deploy: | |
| # deployments: write | |
| jobs: | |
| build-dotnet: | |
| name: Build & Test .NET Service | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: . | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '9.0.x' | |
| # Continous Integration | |
| - name: Restore dependencies | |
| run: dotnet restore ./src/ProjectManagement/ProjectManagement.Presentation/ProjectManagement.Presentation.csproj | |
| - name: Build | |
| run: dotnet build ./src/ProjectManagement/ProjectManagement.Presentation/ProjectManagement.Presentation.csproj --no-restore --configuration Release | |
| # Continous Delivery | |
| - name: Build Docker Image | |
| run: | | |
| docker build --no-cache --progress=plain -f ./src/ProjectManagement/Dockerfile -t ghcr.io/yosef/projectmanagement:latest . | |
| - name: Push Docker Image | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| docker push ghcr.io/${{ github.repository }}/dotnet-service:latest |