Merge pull request #56 from IowaComputerGurus/feature/update-to-dotne… #11
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
| name: Production Release (On Tag) | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Build and Publish | |
| env: | |
| solution-path: './src/GitHub Cost Visualizer.sln' | |
| webproject-path: './src/GitHubCostVisualizer.Web/GitHubCostVisualizer.Web.csproj' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Ensure .NET Installed | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/[email protected] | |
| with: | |
| versionSpec: '6.4.0' | |
| - name: Determine Version | |
| id: gitversion | |
| uses: gittools/actions/gitversion/[email protected] | |
| with: | |
| useConfigFile: true | |
| - name: Restore Packages | |
| run: dotnet restore "${{ env.solution-path }}" | |
| - name: Build | |
| run: dotnet build "${{ env.solution-path }}" --no-restore --configuration Release -p:version=${{ steps.gitversion.outputs.majorMinorPatch }} | |
| - name: Publish | |
| run: dotnet publish "${{ env.webproject-path }}" --runtime win-x64 --configuration Release --output ./App --no-restore -p:version=${{ steps.gitversion.outputs.majorMinorPatch }} | |
| - name: Store App Artifacts | |
| if: github.event_name != 'pull_request' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: published-app | |
| path: App | |
| retention-days: 5 # only need long enough to test/validate | |
| deploy-prod: | |
| needs: [build] | |
| environment: production | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| name: Deploy to Production | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: 'Deploy APP to Prod Server' | |
| uses: azure/webapps-deploy@v2 | |
| with: | |
| app-name: "githubcostvisualizer" | |
| publish-profile: ${{ secrets.PROD_PROFILE }} | |
| package: './published-app/' |