Skip to content

Deploy

Deploy #132

Workflow file for this run

name: Deploy
on:
workflow_run:
workflows: ["Build, Test & Lint"]
branches:
- main
types:
- completed
jobs:
tests:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Run Tests & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bahmutov/npm-install@v1
- run: |
mkdir ~/.ssh
chmod u+rwx,go-rwx ~/.ssh
echo -e "Host ti-broish-api\n Hostname ${{ secrets.DEPLOY_SSH_HOST }}" >> ~/.ssh/config
chmod u+rw,go-rwx ~/.ssh/config
- uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
log-public-key: false
- run: ssh-keyscan -H ${{ secrets.DEPLOY_SSH_HOST }} >> ~/.ssh/known_hosts 2>/dev/null
- run: npm install -g pm2@^5
- run: npm run deploy:staging