2024-08-14 19:30:10 +00:00
|
|
|
name: deploy account
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- dev
|
|
|
|
paths:
|
|
|
|
- "account/**"
|
|
|
|
- ".github/workflows/deploy-account.yml"
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
new-deploy-account:
|
|
|
|
name: Deploy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
LINGDOCS_NPM_TOKEN: ${{ secrets.LINGDOCS_NPM_TOKEN }}
|
|
|
|
steps:
|
2024-08-15 16:43:49 +00:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
2024-08-14 19:30:10 +00:00
|
|
|
with:
|
2024-08-15 16:43:49 +00:00
|
|
|
node-version: 20
|
|
|
|
cache: "npm"
|
2024-08-14 19:30:10 +00:00
|
|
|
- run: |
|
|
|
|
npm install
|
|
|
|
cd website
|
|
|
|
npm install
|
|
|
|
cd ..
|
|
|
|
cd account
|
|
|
|
npm install
|
|
|
|
npm run build
|
|
|
|
npm prune --production
|
|
|
|
cd ..
|
|
|
|
tar --exclude-vcs -czf account.tar.gz account
|
|
|
|
- name: copy tarball to server
|
2024-08-15 17:13:39 +00:00
|
|
|
uses: appleboy/scp-action@v0.1.7
|
2024-08-14 19:30:10 +00:00
|
|
|
with:
|
|
|
|
host: ${{ secrets.HOST }}
|
|
|
|
username: ${{ secrets.USERNAME }}
|
|
|
|
port: ${{ secrets.PORT }}
|
|
|
|
key: ${{ secrets.KEY }}
|
|
|
|
source: "account.tar.gz"
|
|
|
|
target: "."
|
|
|
|
- name: unpack tarball and restart app
|
2024-08-15 16:43:49 +00:00
|
|
|
uses: appleboy/ssh-action@v1.0.3
|
2024-08-14 19:30:10 +00:00
|
|
|
with:
|
|
|
|
host: ${{ secrets.HOST }}
|
|
|
|
username: ${{ secrets.USERNAME }}
|
|
|
|
key: ${{ secrets.KEY }}
|
|
|
|
port: ${{ secrets.PORT }}
|
|
|
|
script: |
|
|
|
|
rm -rf apps/live/account
|
|
|
|
tar -xzf account.tar.gz -C ~/apps/live
|
|
|
|
rm account.tar.gz
|
|
|
|
pm2 restart account
|