Bump actions/upload-artifact from 3 to 4 #309
This file contains 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, Test, and Deploy Intellitect Terminal | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
automerge: | |
if: ${{ github.event_name == 'pull_request' }} | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- uses: fastify/[email protected] | |
with: | |
use-github-auto-merge: true | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '6.x' | |
include-prerelease: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
cache-dependency-path: ./IntellitectTerminal.Web/package-lock.json | |
- name: Install npm packages | |
run: | | |
cd ./IntellitectTerminal.Web | |
npm ci | |
npm run build | |
shell: pwsh | |
- name: Build with dotnet | |
run: dotnet build --configuration Release | |
- name: Ensure Coalesce has run | |
run: | | |
cd ./IntellitectTerminal.Web | |
echo 'Running Coalesce' | |
npm run coalesce | |
if ($LASTEXITCODE -ne 0) { throw "`npm run coalesce` exited with code $LASTEXITCODE" } | |
echo 'Adding Changed Files' | |
git add . | |
echo 'Checking Diff' | |
git diff HEAD --cached --exit-code | |
shell: pwsh | |
- name: Run npm vite tests | |
run: | | |
cd ./IntellitectTerminal.Web | |
npm run test run | |
- name: Test with dotnet | |
run: dotnet test --no-build --configuration Release | |
- name: Dotnet Publish | |
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/IntellitectTerminal | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v4 | |
with: | |
name: .net-app | |
path: ${{env.DOTNET_ROOT}}/IntellitectTerminal | |
deploy: | |
if: github.event_name != 'pull_request' | |
runs-on: ubuntu-latest | |
needs: build-and-test | |
environment: | |
name: 'Production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v3 | |
with: | |
name: .net-app | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v3 | |
with: | |
app-name: 'IntellitectConsole' | |
slot-name: 'production' | |
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | |
package: . |