mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: Build & Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [ 316-upgrade-to-dotnet-10 ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '10.0.x'
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore src/
|
|
|
|
- name: Build
|
|
run: dotnet build src/ --configuration Release --no-restore
|
|
|
|
- name: Publish
|
|
run: dotnet publish src/ -c Release -o publish
|
|
|
|
- name: Copy files to server
|
|
uses: appleboy/scp-action@v0.1.7
|
|
with:
|
|
host: ${{ secrets.DEPLOY_HOST }}
|
|
username: ${{ secrets.DEPLOY_USER }}
|
|
key: ${{ secrets.LD50_DEV_DEPLOY_SSH_KEY }}
|
|
port: 7022
|
|
source: "publish/*"
|
|
target: "/var/www/Berufsschule_HAM"
|
|
strip_components: 1
|
|
|
|
- name: Restart app
|
|
uses: appleboy/ssh-action@v1.2.0
|
|
with:
|
|
host: ${{ secrets.DEPLOY_HOST }}
|
|
username: ${{ secrets.DEPLOY_USER }}
|
|
key: ${{ secrets.LD50_DEV_DEPLOY_SSH_KEY }}
|
|
port: 7022
|
|
script: |
|
|
sudo systemctl restart Berufsschule_HAM.service |