Skip to content

Commit 410a9bd

Browse files
author
¨tedecti¨
committed
last test
1 parent 99bce5e commit 410a9bd

2 files changed

Lines changed: 31 additions & 14 deletions

File tree

.github/workflows/СI_CD.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
name: CI-CD
22

33
on:
4-
push:
5-
branches: [ master ]
4+
pull_request:
5+
branches:
6+
- develop
7+
push:
8+
branches:
9+
- master
610

711
jobs:
812
build:
@@ -18,8 +22,12 @@ jobs:
1822
- name: Restore dependencies
1923
run: dotnet restore ./Eclipse/Eclipse.csproj
2024

21-
- name: Publish
22-
run: dotnet publish ./Eclipse/Eclipse.csproj -c Release -o ./publish /p:UseAppHost=false
25+
- name: Publish project
26+
run: |
27+
dotnet publish ./Eclipse/Eclipse.csproj \
28+
-c Release \
29+
-o ./publish \
30+
/p:UseAppHost=false
2331
2432
- uses: actions/upload-artifact@v4
2533
with:
@@ -35,18 +43,18 @@ jobs:
3543
name: eclipse-app
3644
path: ./deploy
3745

38-
- name: Deploy and restart service
46+
- name: Deploy and restart with Supervisor
3947
run: |
40-
echo "Stopping service..."
41-
sudo systemctl stop eclipse.service
48+
echo "Stopping ASP.NET Core app..."
49+
sudo supervisorctl stop aspnet || true
4250
4351
echo "Deploying new files..."
44-
sudo rm -rf /home/tedecti/eclipse/*
45-
sudo cp -r ./deploy/* /home/tedecti/eclipse/
46-
sudo chown -R tedecti:tedecti /home/tedecti/eclipse
52+
sudo rm -rf /cloudclusters/default_site/bin/release/net5.0/*
53+
sudo cp -r ./deploy/* /cloudclusters/default_site/bin/release/net5.0/
54+
sudo chown -R $USER:$USER /cloudclusters/default_site/bin/release/net5.0
4755
48-
echo "Starting service..."
49-
sudo systemctl start eclipse.service
56+
echo "Starting ASP.NET Core app..."
57+
sudo supervisorctl start aspnet
5058
51-
echo "Service status:"
52-
sudo systemctl status eclipse.service --no-pager
59+
echo "Checking status..."
60+
sudo supervisorctl status aspnet

Eclipse/Controllers/AuthController.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,13 @@ public async Task<ApiResponse<object>> Login(UserDto userDto)
3838
if (token == null) throw new NotFoundException("User");
3939
return new ApiResponse<object> { Message = "Success", Data = new { token } };
4040
}
41+
42+
[HttpPost]
43+
[Route("xdd")]
44+
public async Task<ApiResponse<object>> xdd(UserDto userDto)
45+
{
46+
var token = await _authRepository.Login(userDto);
47+
if (token == null) throw new NotFoundException("User");
48+
return new ApiResponse<object> { Message = "Success", Data = new { token } };
49+
}
4150
}

0 commit comments

Comments
 (0)