Добавлено автоматический показ ответов в финале #102
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Backend | |
on: | |
push: | |
paths: | |
- 'MyOwnGame.Backend/**' | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Подготовка | |
uses: actions/checkout@v4 | |
- name: Установка .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' # SDK Version to use. | |
- name: Компиляция проекта | |
run: dotnet publish -c Release -r linux-x64 --self-contained --output ./Release MyOwnGame.Backend | |
- name: Остановка сервера | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_SERVER }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATEKEY }} | |
passphrase: ${{ secrets.SSH_KEY_PASSWORD }} | |
port: ${{ secrets.SSH_PORT }} | |
script: | | |
echo '${{ secrets.SSH_PASSWORD }}' | sudo -S systemctl stop sigame.service | |
- name: Копирование файлов на сервер | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_SERVER }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATEKEY }} | |
passphrase: ${{ secrets.SSH_KEY_PASSWORD }} | |
port: ${{ secrets.SSH_PORT }} | |
source: "Release/*.*,!Release/appsettings.json" | |
target: "~/sigame/" | |
overwrite: true | |
- name: Запуск сервера | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_SERVER }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATEKEY }} | |
passphrase: ${{ secrets.SSH_KEY_PASSWORD }} | |
port: ${{ secrets.SSH_PORT }} | |
script: | | |
echo '${{ secrets.SSH_PASSWORD }}' | sudo -S systemctl start sigame.service | |