File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : CD
22
33on :
4- push :
5- branches :
6- - master
4+ workflow_run :
5+ workflows : ["CI"]
6+ types :
7+ - completed
78
89jobs :
910 deploy :
1011 runs-on : self-hosted
1112
1213 steps :
13- - name : Checkout code
14- uses : actions/checkout@v4
14+ - name : Download Artifact
15+ uses : actions/download-artifact@v4
16+ with :
17+ name : eclipse-app
18+ path : /home/tedecti/eclipse-app
1519
16- - name : Install .NET SDK
20+ - name : Create systemd service
1721 run : |
18- sudo pacman -S --noconfirm dotnet-sdk
22+ SERVICE_FILE=/etc/systemd/system/eclipse.service
23+ sudo bash -c "cat > $SERVICE_FILE" <<EOL
24+ [Unit]
25+ Description=Eclipse App
26+ After=network.target
1927
20- - name : Build and Publish
21- run : |
22- dotnet publish ./Eclipse/Eclipse.csproj -c Release -o /home/tedecti/eclipse
28+ [Service]
29+ ExecStart=/usr/bin/dotnet /home/tedecti/eclipse-app/Eclipse.dll
30+ WorkingDirectory=/home/tedecti/eclipse-app
31+ Restart=always
32+ User=tedecti
33+
34+ [Install]
35+ WantedBy=multi-user.target
36+ EOL
37+
38+ sudo systemctl daemon-reload
39+ sudo systemctl enable eclipse
40+ sudo systemctl restart eclipse
2341
24- - name : Restart Service
42+ - name : Check app health
2543 run : |
26- sudo systemctl restart eclipse.service
44+ sleep 5
45+ curl -I http://localhost:8080 || echo "App not responding"
You can’t perform that action at this time.
0 commit comments