Skip to content

Summary of Changes: #122

Summary of Changes:

Summary of Changes: #122

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Deploy main site to Server
# Controls when the workflow will run
on:
push:
paths:
- 'SAMT-Website/**'
# 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@v1
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: |
cd SAMT-Website
dotnet build --configuration Release
dotnet publish -c Release
- name: Deploy with rsync
run: rsync -avz -e 'ssh -p 4556 -o StrictHostKeyChecking=no' SAMT-Website/bin/Release/net6.0/publish/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/samt-con/
- name: Restart SAMT Website
run: ssh -p 4556 ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'service samt-con restart'