-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (38 loc) · 1.52 KB
/
develop_bedbrigadedev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Build, Test, and Deploy .NET Project
on:
push:
branches:
- develop # Adjust this to your branch name
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: List all directories
run: |
find . -type d -print
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x' # Adjust the version if needed
- name: Replace Connection String in appsettings.Development.json
run: |
sed -i 's#"DefaultConnection": ".*"#"DefaultConnection": "${{ secrets.DEV_CONNECTION_STRING }}"#' ./BedBrigade.Client/appsettings.Development.json
- name: Restore dependencies
run: dotnet restore
- name: Build project
run: dotnet build --configuration Release --no-restore
- name: Run tests
run: dotnet test
- name: Publish
run: dotnet publish --configuration Release --output ./publish
- name: FTP Deploy
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: ${{ secrets.FTP_DEV_HOST }} # FTP server is now a secret
username: ${{ secrets.FTP_DEV_USERNAME }} # Set up this secret in your GitHub repo settings
password: ${{ secrets.FTP_DEV_PASSWORD }} # Set up this secret in your GitHub repo settings
local-dir: ./publish
server-dir: / # Replace with the target directory on your server
protocol: ftps # or ftp if you are not using a secure connection