-
Notifications
You must be signed in to change notification settings - Fork 1
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
14 changed files
with
205 additions
and
369 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,70 @@ | ||
name: deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "legacy" | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
env: | ||
REMOTE_ROOT: workspace/DucksManager2 | ||
PRODUCTION_SSH_HOST: ${{ secrets.PRODUCTION_SSH_HOST }} | ||
PRODUCTION_SSH_USER: ${{ secrets.PRODUCTION_SSH_USER }} | ||
PRODUCTION_SSH_KEY: ${{ secrets.PRODUCTION_SSH_KEY }} | ||
name: deploy | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
with: | ||
registry: ghcr.io | ||
username: bperel | ||
password: ${{ secrets.DOCKER_REGISTRY_TOKEN_DM }} | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9.8.0 | ||
|
||
- name: Use Node.js 18 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: "pnpm" | ||
|
||
- uses: oven-sh/setup-bun@v1 | ||
|
||
- name: Install dependencies | ||
run: | | ||
pnpm -r i | ||
- name: Build apps | ||
run: | | ||
pnpm i -g turbo | ||
turbo -F '~web...' -F '~api...' build | ||
- name: Retrieve pre-build files | ||
run: | | ||
turbo -F '~web...' -F '~api...' prod:transfer-files-pre | ||
- uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push Docker images | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
turbo -F -F '~web...' -F '~api...' prod:build-docker | ||
- name: Send post-build files | ||
run: | | ||
turbo -F '~web...' -F '~api...' prod:transfer-files-post | ||
- name: Deploy | ||
run: | | ||
turbo -F '~web...' -F '~api...' prod:deploy |
Submodule duck-estimator-db
added at
2aa53c
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 |
---|---|---|
@@ -1,52 +1,5 @@ | ||
FROM node:18.20 AS pnpm | ||
|
||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
FROM pnpm AS build | ||
|
||
WORKDIR /app | ||
COPY . ./ | ||
RUN curl -fsSL https://bun.sh/install | bash | ||
RUN --mount=type=cache,id=pnpm-store-web,target=/app/.pnpm-store \ | ||
pnpm -r -F ~web... -F ~api... i | ||
|
||
RUN pnpm -r -F ~web... -F ~api... run build | ||
|
||
FROM nginx AS web | ||
FROM nginx | ||
LABEL org.opencontainers.image.authors="Bruno Perel" | ||
|
||
COPY apps/web/nginx.conf /etc/nginx/nginx.conf | ||
COPY --from=build /app/apps/web/dist /usr/share/nginx/html | ||
|
||
|
||
FROM pnpm AS api | ||
LABEL org.opencontainers.image.authors="Bruno Perel" | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json ./ | ||
COPY pnpm-*.yaml ./ | ||
|
||
COPY --from=build /app/packages/prisma-clients ./packages/prisma-clients | ||
COPY --from=build /app/packages/types ./packages/types | ||
COPY --from=build /app/packages/prisma-clients/dist/ ./packages/prisma-clients | ||
COPY --from=build /app/packages/types/dist/ ./packages/types | ||
COPY --from=build /app/packages/api/dist/api ./packages/api | ||
|
||
COPY packages/api/package.json ./packages/api | ||
COPY packages/api/translations ./packages/api/translations | ||
COPY packages/api/emails ./packages/api/emails | ||
COPY packages/api/scripts ./packages/api/scripts | ||
|
||
RUN --mount=type=cache,id=pnpm-store,target=/app/.pnpm-store \ | ||
pnpm i --production | ||
|
||
COPY ./packages/api/routes/demo/*.csv ./routes/demo/ | ||
COPY ./packages/api/emails ./emails/ | ||
COPY ./packages/api/.env ./.env | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["node", "packages/api/index.js"] | ||
COPY apps/web/dist /usr/share/nginx/html |
Oops, something went wrong.