-
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (55 loc) · 1.74 KB
/
Copy pathdeploy.yml
File metadata and controls
60 lines (55 loc) · 1.74 KB
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
50
51
52
53
54
55
56
57
58
59
60
name: Backend
on:
push:
branches: ["master"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: production
cancel-in-progress: true
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment:
name: production
deployment: true
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Create sixlabors.lic file
run: echo "${{ secrets.SIXLABORS_LICENSE }}" > ./FLB_API/sixlabors.lic
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Publish Project
run: dotnet publish -c release -r linux-arm64
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: "ignorethislmao"
- name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: Kill Backend
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script: screen -XS FLB quit
- name: Deploy with rsync
run: rsync -avz --exclude='settings.json' ./FLB_API/bin/Release/net10.0/linux-arm64/publish/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.SSH_BACKEND_LOCATION }}
- name: Start Backend
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script: screen -dmS FLB bash -c '${{ secrets.SSH_BACKEND_LOCATION }}/FLB_API'