Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 28 additions & 11 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,27 @@ on:
jobs:
build:

runs-on: self-hosted
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: BuildUI
run: |
npm install
npm test
npm run build
working-directory: web
npm install --prefix web
npm test --prefix web
npm run build --prefix web
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand All @@ -34,27 +41,37 @@ jobs:
dotnet test --no-build --verbosity normal API.Tests/API.Tests.csproj
- name: Publish
run: |
dotnet publish ./api/API.csproj -c Release -o ./release
Copy-Item ./web/build ./release/wwwroot -Recurse -Force
- name: Upload a Build Artifact
dotnet publish ./API/API.csproj -c Release -o ./release
- name: Upload a Build Artifact (.Net)
uses: actions/upload-artifact@v3
with:
name: website
path: ./release/**
if-no-files-found: error

deploy_development:
- name: Upload a Build Artifact (React)
uses: actions/upload-artifact@v3
with:
name: react
path: ./web/build/**
if-no-files-found: error

deploy:

needs: build
runs-on: [ self-hosted, Development ]
environment: Development

steps:
- name: Download a Build Artifact
- name: Download a Build Artifact (.Net)
uses: actions/download-artifact@v3
with:
name: website
path: website
- name: Download a Build Artifact (React)
uses: actions/download-artifact@v3
with:
name: react
path: website/wwwroot
- name: Add secrets
uses: microsoft/variable-substitution@v1
with:
Expand Down
43 changes: 30 additions & 13 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,27 @@ on:
jobs:
build:

runs-on: self-hosted
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: BuildUI
run: |
npm install
npm test
npm run build
working-directory: web
npm install --prefix web
npm test --prefix web
npm run build --prefix web
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand All @@ -33,27 +40,37 @@ jobs:
dotnet test --no-build --verbosity normal API.Tests/API.Tests.csproj
- name: Publish
run: |
dotnet publish ./api/API.csproj -c Release -o ./release
Copy-Item ./web/build ./release/wwwroot -Recurse -Force
- name: Upload a Build Artifact
dotnet publish ./API/API.csproj -c Release -o ./release
- name: Upload a Build Artifact (.Net)
uses: actions/upload-artifact@v3
with:
name: website
path: ./release/**
if-no-files-found: error

deploy_production:
- name: Upload a Build Artifact (React)
uses: actions/upload-artifact@v3
with:
name: react
path: ./web/build/**
if-no-files-found: error

deploy:

needs: build
runs-on: [ self-hosted, Production ]
environment: Production
runs-on: [ self-hosted, Development ]
environment: Development

steps:
- name: Download a Build Artifact
- name: Download a Build Artifact (.Net)
uses: actions/download-artifact@v3
with:
name: website
path: website
- name: Download a Build Artifact (React)
uses: actions/download-artifact@v3
with:
name: react
path: website/wwwroot
- name: Add secrets
uses: microsoft/variable-substitution@v1
with:
Expand Down