mirror of
https://github.com/ArthurDanjou/arthurdanjou.fr.git
synced 2026-01-14 12:14:34 +01:00
configure node.js.yml
This commit is contained in:
55
.github/workflows/node.js.yml
vendored
55
.github/workflows/node.js.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Node.js CI
|
||||
name: Deploy, Install, Build & Run
|
||||
|
||||
on: [push]
|
||||
|
||||
@@ -6,19 +6,44 @@ jobs:
|
||||
build:
|
||||
|
||||
runs-on: self-hosted
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x, 14.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm install
|
||||
- run: npm run build --if-present
|
||||
- run: pm2 reload next-js
|
||||
env:
|
||||
CI: true
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Deploy
|
||||
uses: appleboy/scp-action@master
|
||||
env:
|
||||
HOST: ${{ secrets.SSH_HOST }}
|
||||
USERNAME: ${{ secrets.SSH_USERNAME }}
|
||||
PORT: ${{ secrets.SSH_PORT }}
|
||||
KEY: ${{ secrets.SSH_KEY }}
|
||||
with:
|
||||
source: "."
|
||||
target: "/home/arthur/website"
|
||||
|
||||
- name: Install
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
USERNAME: ${{ secrets.SS_USERNAME }}
|
||||
PORT: ${{ secrets.SSH_PORT }}
|
||||
KEY: ${{ secrets.SSH_KEY }}
|
||||
script: yarn install
|
||||
|
||||
- name: Build
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
USERNAME: ${{ secrets.SS_USERNAME }}
|
||||
PORT: ${{ secrets.SSH_PORT }}
|
||||
KEY: ${{ secrets.SSH_KEY }}
|
||||
script: yarn build-all
|
||||
|
||||
- name: Run
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
USERNAME: ${{ secrets.SS_USERNAME }}
|
||||
PORT: ${{ secrets.SSH_PORT }}
|
||||
KEY: ${{ secrets.SSH_KEY }}
|
||||
script: yarn start
|
||||
Reference in New Issue
Block a user