Skip to content

Commit

Permalink
Create dotnet.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
d2phap authored Aug 23, 2023
1 parent 9c150c4 commit 97589d0
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# 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: [ "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: Go to source folder
run: cd Source
- name: Restore dependencies
run: dotnet restore
- name: 🫧 Build
run: dotnet build --no-restore

- name: 🪄 Publish
run: dotnet publish -c Release -o _Output

- name: 🛫 Upload a build artifact
uses: actions/upload-artifact@v3
with:
name: website
path: ./Source/_Output/**
if-no-files-found: error

deploy_prod:
needs: build
runs-on: ubuntu-latest
steps:
- name: 🚡 Download a Build Artifact
uses: actions/download-artifact@v3
with:
name: website
path: ./Source/_Output

- name: 🚀 Deploy
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./Website/bin/Release/net7.0
server-dir: ./httpdocs/phap
exclude: |
**/.git*
**/.git*/**
**/node_modules/**

0 comments on commit 97589d0

Please sign in to comment.