Skip to content

Commit

Permalink
bundled commits
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal-Delange committed Oct 25, 2023
1 parent d3b7c0a commit c3cbd7b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 19 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build_and_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
GCP_SA_KEY:
required: true
description: 'GCP Service Account Key'
SENTRY_AUTH_TOKEN:
required: true
description: 'Sentry Auth Token'

jobs:
main:
Expand All @@ -41,13 +44,29 @@ jobs:
username: _json_key
password: ${{ secrets.GCP_SA_KEY }}

- name: Setup Sentry CLI
uses: mathieu-bour/setup-sentry-cli@v1
with:
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
organization: 'checkmarble'
project: 'marble-frontend'

- name: Get release
run: |
echo "SENTRY_RELEASE=$(sentry-cli releases propose-version)" >> "$GITHUB_ENV"
# source: https://github.com/docker/build-push-action
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
target: app-builder
tags: ${{ env.IMAGE }}
build-args: |
"SENTRY_RELEASE=${{ env.SENTRY_RELEASE }}"
secrets: |
"SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}"
- name: Auth
uses: 'google-github-actions/auth@v1'
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/main_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ jobs:
actions: read
uses: ./.github/workflows/check.yaml

create_sentry_release:
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: checkmarble
SENTRY_PROJECT: marble-frontend
with:
environment: production

build_and_deploy:
needs: check
permissions:
Expand All @@ -36,3 +27,4 @@ jobs:
version: latest
secrets:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY_STAGING }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ARG SENTRY_RELEASE
ENV SENTRY_RELEASE=$SENTRY_RELEASE
RUN corepack enable
RUN apt-get update
RUN apt-get -y install ca-certificates
COPY . /app
WORKDIR /app

FROM base AS prod-deps
# RUN --mount=type=cache,id=pnpm,target=$PNPM_HOME/store pnpm install --prod --frozen-lockfile
RUN pnpm install --prod --frozen-lockfile

FROM base AS build
# RUN --mount=type=cache,id=pnpm,target=$PNPM_HOME/store pnpm install --frozen-lockfile
RUN pnpm install --frozen-lockfile
RUN pnpm run -r build-with-sourcemaps
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN \
SENTRY_AUTH_TOKEN=$(cat /run/secrets/SENTRY_AUTH_TOKEN) && \
export SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN && \
pnpm run -r build-with-sourcemaps --release $SENTRY_RELEASE

FROM base AS app-builder
ENV NODE_ENV=production
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"devDependencies": {
"@remix-run/dev": "^1.19.3",
"@remix-run/eslint-config": "^1.19.3",
"@sentry/cli": "^2.21.2",
"@svgr/core": "^8.1.0",
"@svgr/plugin-jsx": "^8.1.0",
"@svgr/plugin-prettier": "^8.1.0",
Expand Down Expand Up @@ -73,7 +74,6 @@
"@remix-run/node": "^1.19.3",
"@remix-run/react": "^1.19.3",
"@remix-run/serve": "^1.19.3",
"@sentry/cli": "^2.21.2",
"@sentry/remix": "^7.74.0",
"@tanstack/react-table": "^8.10.6",
"@tanstack/react-virtual": "3.0.0-beta.61",
Expand Down
1 change: 0 additions & 1 deletion packages/app-builder/.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ FIREBASE_STORAGE_BUCKET=tokyo-country-381508.appspot.com
FIREBASE_MESSAGING_SENDER_ID=1047691849054
FIREBASE_APP_ID=1:1047691849054:web:a5b69dd2ac584c1160b3cf

SENTRY_AUTH_TOKEN=dummy
SENTRY_DSN=dummy
SENTRY_ENVIRONMENT=development
1 change: 0 additions & 1 deletion packages/app-builder/src/utils/environment.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ type ServerPublicEnvVarName =
| 'MARBLE_API_DOMAIN'
| 'MARBLE_APP_DOMAIN'
| 'NODE_ENV'
| 'SENTRY_AUTH_TOKEN'
| 'SENTRY_DSN'
| 'SENTRY_ENVIRONMENT'
| 'SESSION_MAX_AGE';
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c3cbd7b

Please sign in to comment.