oops #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
- 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 | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
port: ${{ secrets.PORT }} | |
key: ${{ secrets.KEY }} | |
source: "account.tar.gz" | |
target: "." | |
- name: unpack tarball and restart app | |
uses: appleboy/[email protected] | |
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 |