Skip to content

The most significant changes include a major refactoring of the `Inde… #45

The most significant changes include a major refactoring of the `Inde…

The most significant changes include a major refactoring of the `Inde… #45

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Deploy to Server
# Controls when the workflow will run
on:
push:
paths:
- 'Nekos/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.SSH_HOST }}
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Install dependencies
run: dotnet restore
- name: Build
run: |
cd Nekos
dotnet build --configuration Release
dotnet publish -c Release
- name: Deploy with rsync
run: rsync -avz -e 'ssh -p 4556 -o StrictHostKeyChecking=no' Nekos/bin/Release/net8.0/publish/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/nekos/
- name: Restart Nekos Website
run: ssh -p 4556 ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'service nekos restart'