Skip to content

Articles

Articles #70

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: App Settings Variable Substitution
uses: microsoft/variable-substitution@v1
with:
files: '**/Inshapardaz.Api/appsettings.json'
env:
AppSettings.DefaultConnection: ${{ secrets.CONNECTIONSTRING }}
AppSettings.S3ServiceUrl: ${{ secrets.S3SERVICEURL }}
AppSettings.S3Accesskey: ${{ secrets.S3ACCESSKEY }}
AppSettings.S3BucketName: ${{ secrets.S3BUCKETNAME }}
AppSettings.S3AccessSecret: ${{ secrets.S3ACCESSSECRET }}
AppSettings.SmtpHost: ${{ secrets.SMTPHOST }}
AppSettings.SmtpPort: ${{ secrets.SMTPPORT }}
AppSettings.SmtpUser: ${{ secrets.SMTPUSER }}
AppSettings.SmtpPass: ${{ secrets.SMTPPASS }}
AppSettings.EmailFrom: ${{ secrets.EMAILFROM }}
AppSettings.EmailFromName: ${{ secrets.EMAILFROMNAME }}
AppSettings.Secret: ${{ secrets.SECRET }}
AppSettings.FrontEndUrl: ${{ secrets.FRONTENDURL }}
AppSettings.ResetPasswordPagePath: ${{ secrets.RESETPASSWORDPAGEPATH }}
AppSettings.RegisterPagePath: ${{ secrets.REGISTERPAGEPATH }}
AppSettings.FileStoreType: ${{ secrets.FILESTORETYPE }}
AppSettings.Allowed_Origins: ${{ secrets.ALLOWEDORIGINS }}
AppSettings.DefaultLibraryId": ${{ secrets.DEFAULT_LIBRARY }}
- name: Build
run: dotnet build --no-restore
# - name: Test
# run: dotnet test --no-build --verbosity normal
- name: Publish
run: dotnet publish -c Release -r win-x86 -o ./Release ./src/Inshapardaz.Api/Inshapardaz.Api.csproj
- name: Sync files
uses: SamKirkland/FTP-Deploy-Action@4.3.0
with:
server: ${{ secrets.DEPLOY_FTP_SERVER }}
username: ${{ secrets.DEPLOY_FTP_USERNAME }}
password: ${{ secrets.DEPLOY_FTP_PASSWORD }}
server-dir: /api/
local-dir: ./Release/