Skip to content

Add service files [skip-ci] #57

Add service files [skip-ci]

Add service files [skip-ci] #57

Workflow file for this run

name: Action
on:
push:
branches:
- main
jobs:
ci:
name: CI
if: "!contains(github.event.head_commit.message, '[skip')"
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '18'
- name: Checkout
uses: actions/checkout@master
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Build
if: "!contains(github.event.head_commit.message, '[skip-build')"
run: npm run build
- name: Copy to server
if: "!contains(github.event.head_commit.message, '[skip-build')"
uses: appleboy/scp-action@master
with:
host: ${{ secrets.DEPLOY_SERVER_HOST }}
username: ${{ secrets.DEPLOY_SERVER_USERNAME }}
password: ${{ secrets.DEPLOY_SERVER_PASSWORD }}
source: .output/*
target: ${{ secrets.DEPLOY_SERVER_TARGET }}
- name: Modify server
if: "!contains(github.event.head_commit.message, '[skip-build')"
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_SERVER_HOST }}
username: ${{ secrets.DEPLOY_SERVER_USERNAME }}
password: ${{ secrets.DEPLOY_SERVER_PASSWORD }}
script: |
cd ${{ secrets.DEPLOY_SERVER_TARGET }}
systemctl stop cookbook
mv server server-old
mv .output server
systemctl start cookbook
rm -rf server-old