Deploy #1
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: Deploy | |
on: | |
workflow_run: | |
workflows: ['Tests'] | |
types: | |
- completed | |
jobs: | |
deploy: | |
if: ${{ github.event.workflow_run.conclusion == 'success' && github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/build | |
- name: Apply database migrations | |
run: pnpx prisma migrate deploy | |
env: | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
- name: Install Railway CLI | |
run: pnpm add --global @railway/cli | |
- name: Deploy to Railway | |
run: railway up --service="nestjs-starter" | |
env: | |
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | |
REDIS_URL: ${{ secrets.REDIS_URL }} |