-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
packages: write | ||
|
||
jobs: | ||
docker-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
- uses: docker/metadata-action@v5 | ||
id: meta | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=sha | ||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: ./projects/server | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
upload-assets: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: package.json | ||
- run: npm ci | ||
- run: npm run build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: admin | ||
path: ./projects/admin/dist | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: client | ||
path: ./projects/client/dist |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
FROM node:20-slim AS base | ||
|
||
RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
FROM base AS build | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json tsconfig.json ./ | ||
COPY prisma prisma | ||
COPY src src | ||
|
||
RUN npm install | ||
RUN npx prisma generate | ||
RUN npm run build | ||
|
||
|
||
FROM base AS node_modules | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json ./ | ||
RUN npm install --omit=dev | ||
|
||
|
||
FROM base | ||
|
||
WORKDIR /app | ||
|
||
COPY bin.js package.json ./ | ||
COPY --from=build /app/out out | ||
COPY --from=node_modules /app/node_modules node_modules | ||
COPY --from=build /app/node_modules/.prisma node_modules/.prisma | ||
COPY --from=build /app/node_modules/@prisma/client node_modules/@prisma/client | ||
|
||
ENV NODE_ENV=production | ||
|
||
CMD ["npm", "start"] |
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