Build AHK.GradeManagement #1
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: Build AHK.GradeManagement | |
| on: | |
| pull_request: | |
| branches: dev # Run workflow on PRs to the main branch. | |
| # Run workflow on pushes to any branch, except the main branch. | |
| # push: | |
| # branches-ignore: dev | |
| # Allows you to run this workflow manually from the Actions tab. | |
| workflow_dispatch: | |
| # 👇 Allows this workflow to be called from the deployment workflow, but the parameters must be provided. | |
| workflow_call: | |
| inputs: | |
| artifactName: | |
| description: The name of the artifact to upload to. | |
| required: true | |
| type: string | |
| env: | |
| # 👇 Provide a default artifact name for when this workflow is not called by the deployment workflow. | |
| artifactName: ${{ inputs.artifactName || 'buildArtifact' }} | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repo source code | |
| uses: actions/checkout@v3 | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: "9.0.x" | |
| - name: "Run dotnet restore" | |
| working-directory: src/Ahk.GradeManagement | |
| run: dotnet restore Ahk.GradeManagement.sln | |
| - name: "Run dotnet publish" | |
| working-directory: src/Ahk.GradeManagement | |
| run: dotnet publish Ahk.GradeManagement.Api/Ahk.GradeManagement.Api.csproj --configuration Release --property:PublishDir='./output/Ahk.GradeManagement.Api' | |
| ./output/Ahk.GradeManagement.Api | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.artifactName }} | |
| path: ./output # Put the path to the build artifact files directory here. |