Refactor security middleware in app.js #11
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: Node.js Production | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: [self-hosted, main] | |
env: | |
NODE_ENV: production | |
DOTENV_KEY: ${{ secrets.DOTENV_KEY }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set dotenv variable | |
run: | | |
export NODE_ENV=production | |
export DOTENV_KEY="${{ secrets.DOTENV_KEY }}" | |
export NODE_TLS_REJECT_UNAUTHORIZED=0 | |
- name: Start PM2 | |
run: pm2 status || pm2 resurrect | |
- name: Install Node.js dependencies | |
run: npm install | |
- name: Start application | |
run: pm2 describe tictactoe-production &> /dev/null && pm2 reload ecosystem.config.js --env production --update-env || pm2 start ecosystem.config.js --env production |