chore(deps): update typescript-eslint monorepo to v8.8.1 #177
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
# This workflow is run on a push on branch main | |
# | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: bot-production | |
concurrency: | |
group: deploy-production | |
cancel-in-progress: false | |
steps: | |
- name: Checkout current commit | |
uses: actions/checkout@6b42224f41ee5dfe5395e27c8b2746f1f9955030 # pin@v3 | |
- name: Use Node.JS 18 | |
uses: actions/setup-node@aca7b64a59c0063db8564e0ffdadd3887f1cbae5 # pin@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
- name: Install npm build dependencies | |
run: npm ci | |
- name: Build the bot application | |
run: npm run build | |
- name: Remove unnecessary files for deployment | |
run: | | |
rm -rf ./src ./node_modules ./tsconfig.json ./.env.preset ./.git ./.github ./logs ./database.sqlite | |
- name: Deploy files to production server | |
uses: wlixcc/SFTP-Deploy-Action@da88a4dbe95286266bbac3c0b2b8284048d20c8f # pin@v1.2.4 | |
with: | |
server: ${{secrets.PRODUCTION_DEPLOY_SSH_HOST}} | |
port: ${{secrets.PRODUCTION_DEPLOY_SSH_PORT}} | |
username: ${{secrets.PRODUCTION_DEPLOY_SSH_USERNAME}} | |
ssh_private_key: ${{secrets.PRODUCTION_DEPLOY_SSH_KEY}} | |
local_path: './' | |
remote_path: ${{secrets.PRODUCTION_DEPLOY_SSH_REMOTE_PATH}} | |
sftpArgs: '-o ConnectTimeout=5' | |
sftp_only: true | |
- name: Restart the production bot instance | |
uses: appleboy/ssh-action@551964ebda1034f0b5449d74db25c42e371ca1f7 # pin@v1.0.0 | |
with: | |
host: ${{secrets.PRODUCTION_DEPLOY_SSH_HOST}} | |
port: ${{secrets.PRODUCTION_DEPLOY_SSH_PORT}} | |
username: ${{secrets.PRODUCTION_DEPLOY_SSH_USERNAME}} | |
key: ${{secrets.PRODUCTION_DEPLOY_SSH_KEY}} | |
script: | | |
export NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
cd ${{secrets.PRODUCTION_DEPLOY_SSH_REMOTE_PATH}} | |
npm ci --omit=dev | |
pm2 restart ./ecosystem.config.js --env production |