Only make tests mandatory for PRs #430
Workflow file for this run
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
| # Docs for the Azure Web Apps Deploy action: https://go.microsoft.com/fwlink/?linkid=2134798 | |
| # More GitHub Actions for Azure: https://go.microsoft.com/fwlink/?linkid=2135048 | |
| name: CI/CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: "Checkout Github Action" | |
| uses: actions/checkout@master | |
| - name: Set up .NET Core | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Server | |
| run: scripts/server | |
| - name: Test | |
| run: scripts/test | |
| deploy: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - name: "Checkout Github Action" | |
| uses: actions/checkout@master | |
| - name: Set up .NET Core | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Build | |
| run: scripts/build | |
| - name: Publish | |
| run: scripts/publish ${{env.DOTNET_ROOT}}/myapp | |
| - name: Run Azure webapp deploy action using publish profile credentials | |
| uses: azure/webapps-deploy@v2 | |
| with: | |
| app-name: kooktime | |
| slot-name: Production | |
| publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_0F6BD73EF94E4FA98AD4FB7410D07D5C }} | |
| package: ${{env.DOTNET_ROOT}}/myapp |