Fixed breaking dto #32
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
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- develop | |
paths: | |
[ | |
'src/**', | |
'.github/workflows/deploy.yml', | |
'Dockerfile', | |
'package.json', | |
'fly.toml', | |
] | |
jobs: | |
deploy-backend: | |
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'stage' }} | |
runs-on: ubuntu-latest | |
name: Deploy backend | |
env: | |
FLY_ACCESS_TOKEN: ${{ secrets.FLY_ACCESS_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install fly CLI | |
run: | | |
curl -L https://fly.io/install.sh | sh | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: pnpm install | |
run: pnpm install | |
- name: Deploy migrations | |
env: | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
DATABASE_APP_NAME: ${{ vars.DATABASE_APP_NAME }} | |
run: | | |
~/.fly/bin/fly proxy 5432:5432 $DATABASE_APP_NAME.flycast --app $DATABASE_APP_NAME --access-token $FLY_ACCESS_TOKEN & | |
pnpm db:deploy-migrations | |
kill %1 | |
- name: Deploy | |
env: | |
FLY_APP_NAME: ${{ vars.FLY_APP_NAME }} | |
FLY_CONFIG_FILE_NAME: ${{ github.ref == 'refs/heads/main' && 'fly.prod.toml' || 'flu.stage.toml' }} | |
run: | | |
~/.fly/bin/fly deploy \ | |
--config $FLY_CONFIG_FILE_NAME \ | |
--dockerfile Dockerfile \ | |
--app $FLY_APP_NAME \ | |
--access-token $FLY_ACCESS_TOKEN |