Repo desc...
Se o meu trabalho foi útil de qualquer maneira, considere doar qualquer valor através do das seguintes plataformas:
| name: Node.js Deploy | |
| on: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Copy repository contents via scp | |
| uses: appleboy/scp-action@master | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| password: ${{ secrets.SSH_PASS }} | |
| port: ${{ secrets.SSH_PORT }} | |
| source: "." | |
| target: ${{ secrets.PROJECT_PATH }} | |
| build: | |
| needs: deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Building Laravel Site | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| password: ${{ secrets.SSH_PASS }} | |
| port: ${{ secrets.SSH_PORT }} | |
| script: | | |
| cd ${{ secrets.PROJECT_PATH }} | |
| git pull origin main | |
| [ -f .env ] || cp .env.example .env | |
| pnpm install | |
| pnpm install --only=prod | |
| pm2 restart app |
| [Unit] | |
| Description=Node.js App Systemd Unit | |
| Documentation=https://example.com | |
| After=network.target | |
| [Service] | |
| Environment=NODE_PORT=3000 | |
| Type=simple | |
| User=caddy | |
| ExecStart=/usr/bin/node /var/www/site.com/api/app.js | |
| Restart=on-failure | |
| [Install] | |
| WantedBy=multi-user.target |
| { | |
| "name": "appname", | |
| "version": "1.0.0", | |
| "description": "App description", | |
| "main": "app.js", | |
| "scripts": { | |
| "start": "node app" | |
| }, | |
| "keywords": [], | |
| "author": "Your Name <your@email.com>", | |
| "license": "ISC" | |
| } |
| { | |
| "npm.packageManager": "pnpm" | |
| } |
| { | |
| "version": "2.0.0", | |
| "tasks": [ | |
| { | |
| "label": "NPM Install", | |
| "type": "npm", | |
| "script": "install", | |
| "problemMatcher": [], | |
| "detail": "pnpm install", | |
| "group": "none", | |
| "presentation": { | |
| "reveal": "always", | |
| "panel": "new" | |
| } | |
| }, | |
| { | |
| "label": "NPM Start", | |
| "type": "npm", | |
| "script": "start", | |
| "problemMatcher": [], | |
| "detail": "pnpm run start", | |
| "group": "none", | |
| "runOptions": { | |
| "runOn": "folderOpen" | |
| }, | |
| "presentation": { | |
| "reveal": "never", | |
| "panel": "new" | |
| } | |
| }, | |
| { | |
| "label": "NPM Dev", | |
| "type": "npm", | |
| "script": "dev", | |
| "problemMatcher": [], | |
| "detail": "pnpm run dev", | |
| "group": "none", | |
| "presentation": { | |
| "reveal": "never", | |
| "panel": "new" | |
| } | |
| } | |
| ] | |
| } |