Skip to content

Commit

Permalink
add deployment job for nestjs
Browse files Browse the repository at this point in the history
  • Loading branch information
sitek94 committed Nov 25, 2023
1 parent 84b562c commit eedcf01
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,22 @@ jobs:

- name: Build
run: pnpm build

deploy-nestjs:
name: Deploy NestJS App
runs-on: ubuntu-latest
# needs: [typecheck, lint, test, build]
needs: [validate]
if: ${{ github.ref == 'refs/heads/main' }}

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: 🎈 Setup Fly
uses: superfly/flyctl-actions/[email protected]

- name: 🚀 Deploy
run: flyctl deploy --config ./apps/nestjs/fly.toml --remote-only --build-arg COMMIT_SHA=${{ github.sha }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
3 changes: 0 additions & 3 deletions apps/nestjs/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
app = "pnpm-monorepo-nestjs"
primary_region = "waw"

[build]
dockerfile = "./apps/nestjs/Dockerfile"

[http_service]
internal_port = 2222
force_https = true
Expand Down
4 changes: 2 additions & 2 deletions apps/nestjs/src/app.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ describe('AppController', () => {
})

describe('root', () => {
it('should return "Hello World!"', () => {
expect(appController.getHello()).toBe('Hello World!')
it('contains "Hello World"', () => {
expect(appController.getHello()).toContain('Hello World')
})
})
})
2 changes: 1 addition & 1 deletion apps/nestjs/src/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { Injectable } from '@nestjs/common'
@Injectable()
export class AppService {
getHello(): string {
return 'Hello World!'
return 'Hello World 1'
}
}
3 changes: 0 additions & 3 deletions apps/remix/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
app = "pnpm-monorepo-remix"
primary_region = "waw"

[build]
dockerfile = "./apps/remix/Dockerfile"

[http_service]
internal_port = 3333
force_https = true
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"build:nestjs": "pnpm --F nestjs build",
"build:remix": "pnpm --F remix build",
"build": "pnpm --F './apps/**' build",
"deploy:nestjs": "fly deploy --config .apps/nestjs/fly.toml",
"deploy:remix": "fly deploy --config .apps/remix/fly.toml",
"deploy:nestjs": "fly deploy --config ./apps/nestjs/fly.toml --dockerfile ./apps/nestjs/Dockerfile",
"deploy:remix": "fly deploy --config ./apps/remix/fly.toml --dockerfile ./apps/remix/Dockerfile",
"develop:nestjs": "pnpm --F nestjs develop",
"develop:remix": "pnpm --F remix develop",
"develop": "pnpm --F './apps/**' develop",
Expand Down

0 comments on commit eedcf01

Please sign in to comment.