Skip to content

.

. #367

Workflow file for this run

name: .NET
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
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: Build
run: dotnet build --no-restore
#- name: Test
# run: dotnet test --no-build --verbosity normal
#################################
# πŸ‘‰ PREPARE wwwroot FOLDER πŸ‘ˆ #
#################################
- name: Script
run: |
set-location ReactWithDotNet.WebSite/wwwroot/
npm install
npm run-script build
Remove-Item 'react-with-dotnet' -Recurse
Remove-Item 'package.json'
Remove-Item 'package-lock.json'
Remove-Item 'index.jsx'
shell: pwsh
##################
# πŸ‘‰ PUBLISH πŸ‘ˆ #
##################
- uses: EasyDesk/action-dotnet-publish@v1
with:
# (Optional) The path to the project that should be published.
# If not specified, defaults to '.'.
path: 'ReactWithDotNet.WebSite/'
# (Optional) Additional command line arguments to be passed to 'dotnet test'.
# If not specified, defaults to 'packages'.
output-dir: 'FinalWebApp'
# (Optional) The build configuration.
# If not specified, defaults to 'Release'.
#build-configuration: Release
# (Optional) Whether to skip the build using the '--no-build' flag.
# If not specified, defaults to true.
skip-build: false
##############################
# πŸ‘‰ REMOVE UNUSED FILES πŸ‘ˆ #
##############################
- name: Script
run: |
Remove-Item 'FinalWebApp/*.pdb'
Remove-Item 'FinalWebApp/*.xml'
shell: pwsh
# ############################
# # πŸ‘‰ DEPLOY REMOTE FTP πŸ‘ˆ #
# ############################
#- name: πŸ“‚ Sync files
# uses: SamKirkland/[email protected]
# with:
# server: win5173.site4now.net
# username: ${{ secrets.FTP_USER_NAME }}
# password: ${{ secrets.FTP_PASSWORD }}
# local-dir: FinalWebApp/
# server-dir: submission/