eslint deps #60
This file contains hidden or 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: Master CI/CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18.19.1] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: npm install, build, lint and test | |
| run: | | |
| npm install | |
| npm run build --if-present | |
| npm run lint --if-present | |
| npm run test --if-present | |
| env: | |
| CI: true | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: SSH and deploy node app | |
| uses: appleboy/ssh-action@5711a203b3207eb1c6cebec6ac2152ab210ec3ae | |
| env: | |
| BROADCAST_NETWORK: ${{secrets.BROADCAST_NETWORK}} | |
| BROADCASTER_USERNAME: ${{secrets.BROADCASTER_USERNAME}} | |
| BROADCASTER_POSTING_WIF: ${{secrets.BROADCASTER_POSTING_WIF}} | |
| API_PORT: ${{secrets.API_PORT}} | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USERNAME }} | |
| key: ${{ secrets.SSH_KEY }} | |
| port: ${{ secrets.SSH_PORT }} | |
| envs: BROADCAST_NETWORK,BROADCASTER_USERNAME,BROADCASTER_POSTING_WIF,API_PORT | |
| script: | | |
| cd ~/hsapi | |
| git pull origin main | |
| npm install | |
| export API_PORT=$API_PORT | |
| export BROADCAST_NETWORK=$BROADCAST_NETWORK | |
| export BROADCASTER_USERNAME=$BROADCASTER_USERNAME | |
| export BROADCASTER_POSTING_WIF=$BROADCASTER_POSTING_WIF | |
| pm2 reload api --update-env || pm2 start --no-automation --max-memory-restart 900M npm --name "api" -- start |