diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 8a6feff2f..abcc237d7 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -60,6 +60,7 @@ jobs: # Build using the file docker build --secret id=npmrc,src=.npmrc_temp -t edr-${{needs.environment.outputs.target}} . + docker build --secret id=npmrc,src=.npmrc_temp --target passenger-migration -t edr-passenger-migration-${{needs.environment.outputs.target}} . . # Shred/Remove the sensitive file rm .npmrc_temp @@ -86,6 +87,11 @@ jobs: - name: ๐Ÿ“‹ Copy ${{ matrix.service }} Environment run: cp ~/environment/edr/${{needs.environment.outputs.target}}/${{ matrix.env_file }} .env + - name: ๐Ÿงช Run Passenger API migrations + if: ${{ matrix.service == 'passenger-api' }} + run: | + docker run --rm --env-file .env edr-passenger-migration-${{needs.environment.outputs.target}} + - name: ๐Ÿš€ Start ${{ matrix.service }} Service run: docker compose --project-name="edr-${{needs.environment.outputs.target}}" up -d --force-recreate ${{ matrix.service }} --build diff --git a/.gitignore b/.gitignore index 132db3f2a..f03097e83 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ coverage/ # OS/editor .DS_Store .idea/ -.vscode/ \ No newline at end of file +.vscode/ +.npmrc \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index ce7a77ab8..b98a51043 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,6 +66,10 @@ COPY --from=build /app/packages ./../../packages EXPOSE 3001 CMD ["node", "dist/main.js"] +FROM build as passenger-migration +WORKDIR /app/apps/edr-passenger-api +CMD ["pnpm","run","prisma:migrate"] + FROM nginx:1.27-alpine AS freight-web-portal