Skip to content

Commit

Permalink
chore: update packages and build (#69)
Browse files Browse the repository at this point in the history
* update packages
* add build YAML
  • Loading branch information
DaveSkender authored Jan 8, 2021
1 parent 45d8360 commit 8eb7e23
Show file tree
Hide file tree
Showing 4 changed files with 271 additions and 167 deletions.
126 changes: 111 additions & 15 deletions .github/build.main.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,115 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- main
- master

pr:
- master

name: $(BuildID)-$(SourceBranchName)

resources:

repositories:
- repository: self
type: git
ref: master

jobs:

- job: Job_1
displayName: Web API
pool:
vmImage: windows-2019

steps:

- checkout: self
clean: true

- task: PowerShell@2
displayName: Swap config files
inputs:
targetType: inline
script: >
Copy-Item "Server/WebApi/appsettings.Token.json" -Destination "Server/WebApi/appsettings.json" -Force
Remove-Item "Server/WebApi/appsettings.Token.json" -Force
- task: replacetokens@3
displayName: Update configurations
inputs:
rootDirectory: Server
targetFiles: '**\*appsettings.json'
escapeType: none
tokenPrefix: __
tokenSuffix: __

- task: UseDotNet@2
displayName: Use .Net SDK 5.0.x
continueOnError: True
inputs:
version: 5.0.x

- task: DotNetCoreCLI@2
displayName: dotnet restore
inputs:
command: restore
projects: Server\**\*.csproj

- task: DotNetCoreCLI@2
displayName: dotnet publish
inputs:
command: publish
publishWebProjects: false
projects: Server\**\*.csproj
arguments: -c Release -o $(Build.ArtifactStagingDirectory)

- task: CopyFiles@2
displayName: Stage artifacts
inputs:
SourceFolder: Server
Contents: "**/WebApi.zip"
TargetFolder: $(Build.ArtifactStagingDirectory)
CleanTargetFolder: true
OverWrite: true
flattenFolders: true

- task: PublishBuildArtifacts@1
displayName: Save artifacts

- job: Job_2
displayName: Website
pool:
vmImage: ubuntu-18.04

steps:
- checkout: self
clean: true

- task: UseNode@1
displayName: Use Node 12.18.x
inputs:
version: 12.18.x

- task: Npm@1
displayName: Install packages
inputs:
workingDir: Client
verbose: false

pool:
vmImage: 'ubuntu-latest'
- task: Npm@1
displayName: Build
inputs:
command: custom
workingDir: Client
verbose: false
customCommand: run build.prod

steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- task: ArchiveFiles@2
displayName: Stage artifacts
inputs:
rootFolderOrFile: Client/dist/app
includeRootFolder: false
archiveFile: $(Build.ArtifactStagingDirectory)/Website.zip

- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
- task: PublishBuildArtifacts@1
displayName: Save artifacts
Loading

0 comments on commit 8eb7e23

Please sign in to comment.