Repository navigation
Update README.md #228
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: Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install Dependencies | |
| run: | | |
| npm install | |
| cd apps/web && npm install | |
| - name: Build Tunnel | |
| run: | | |
| cd apps/tunnel | |
| npm run build | |
| - name: Build Internal Check | |
| run: | | |
| cd apps/internal-check | |
| npm install | |
| npm run build | |
| - name: Build Cron | |
| run: | | |
| cd apps/cron | |
| npm install | |
| npm run build | |
| - name: Deploy Tunnel Files | |
| uses: appleboy/scp-action@master | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.SSH_PORT }} | |
| source: "apps/tunnel/dist,apps/tunnel/package.json" | |
| target: "/root/outray/tunnel" | |
| strip_components: 2 | |
| - name: Deploy Internal Check Files | |
| uses: appleboy/scp-action@master | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.SSH_PORT }} | |
| source: "apps/internal-check/dist,apps/internal-check/package.json" | |
| target: "/root/outray/internal-check" | |
| strip_components: 2 | |
| - name: Deploy Cron Files | |
| uses: appleboy/scp-action@master | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.SSH_PORT }} | |
| source: "apps/cron/dist,apps/cron/package.json" | |
| target: "/root/outray/cron" | |
| strip_components: 2 | |
| - name: Deploy Script | |
| uses: appleboy/scp-action@master | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.SSH_PORT }} | |
| source: "deploy.sh,deploy/migrations" | |
| target: "/root/outray" | |
| - name: Restart Server (Blue/Green) | |
| uses: appleboy/ssh-action@master | |
| env: | |
| REDIS_URL: ${{ secrets.REDIS_URL }} | |
| REDIS_TUNNEL_TTL_SECONDS: "120" | |
| REDIS_HEARTBEAT_INTERVAL_MS: "20000" | |
| TIGER_DATA_URL: ${{ secrets.TIGER_DATA_URL }} | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| INTERNAL_API_SECRET: ${{ secrets.INTERNAL_API_SECRET }} | |
| PAYSTACK_SECRET_KEY: ${{ secrets.PAYSTACK_SECRET_KEY }} | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.SSH_PORT }} | |
| envs: REDIS_URL,REDIS_TUNNEL_TTL_SECONDS,REDIS_HEARTBEAT_INTERVAL_MS,TIGER_DATA_URL,DATABASE_URL,INTERNAL_API_SECRET,PAYSTACK_SECRET_KEY | |
| script: | | |
| chmod +x /root/outray/deploy.sh | |
| /root/outray/deploy.sh |