. #358
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: .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/ |