Skip to content

LIVE - Update and Restart the NutriLog App #8

LIVE - Update and Restart the NutriLog App

LIVE - Update and Restart the NutriLog App #8

Workflow file for this run

name: LIVE - Update and Restart the `NutriLog` App
# Trigger action manually
on: workflow_dispatch
env:
APP_DIR: /home/${{vars.USER}}/inst/app/nutrilog/ # Directory of the application
PRJ: nutrilog # The name of the project
SERVICE: appNutriLog.service # The name of the service to manage
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repository on the GitHub environment.
uses: actions/checkout@v3
- name: Install dependencies and build the project.
run: |
npm install --omit=optional --omit=dev
- name: Add application files to the archive.
uses: montudor/action-zip@v1
with:
args: zip -qq --exclude=*.git* -r ${{env.PRJ}}.zip ./
- name: Validate the existence of the archive.
run: |
pwd
ls -lh
- name: Validate SSH connection.
uses: appleboy/ssh-action@master
with:
host: ${{vars.HOST}}
username: ${{vars.USER}}
key: ${{secrets.SSH_KEY}}
script: |
pwd
whoami
- name: Copy files to Remote Server.
uses: appleboy/scp-action@master
with:
host: ${{vars.HOST}}
username: ${{vars.USER}}
key: ${{secrets.SSH_KEY}}
source: ${{env.PRJ}}.zip
target: ${{env.APP_DIR}}