Skip to content

Commit

Permalink
update build args
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Egorov committed Nov 19, 2024
1 parent bbc5c02 commit 58558f7
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 22 deletions.
7 changes: 6 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ module.exports = {
ecmaVersion: 2020,
project: "./tsconfig.json",
},
ignorePatterns: ["*.cjs", "!.lintstagedrc.js", ".lintstagedrc.js", "next.config.js"],
ignorePatterns: [
"*.cjs",
"!.lintstagedrc.js",
".lintstagedrc.js",
"next.config.js",
],
plugins: ["@typescript-eslint"],
root: true,
env: {
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ jobs:
sha=${{ github.sha }}
sha_short=${{ env.GITHUB_SHA_SHORT }}
app_env=${{ vars.APP_ENV }}
NEXT_PUBLIC_PROXY_KEY=${{ secrets.NEXT_PUBLIC_PROXY_KEY }}
NEXT_PUBLIC_MIXPANEL_TOKEN=${{ secrets.NEXT_PUBLIC_MIXPANEL_TOKEN }}
NEXT_PUBLIC_ANALYTICS_ENABLED=${{ secrets.NEXT_PUBLIC_ANALYTICS_ENABLED }}
- name: Apply AWS k8s config
run: aws eks update-kubeconfig --name ${{ vars.AWS_CLUSTER }} --region ${{ vars.AWS_REGION }}
Expand All @@ -83,10 +86,7 @@ jobs:
--set imageTag="${{ env.GITHUB_SHA_SHORT }}" \
--set host=${{ env.APP_DOMAIN }} \
--set appName=${{ vars.APP_NAME }} \
--set ghcrSecret=${{ secrets.GHCR_SECRET }} \
--set secrets.publicProxyKey=${{ secrets.NEXT_PUBLIC_MIXPANEL_TOKEN }} \
--set secrets.publicMixPanelToken=${{ secrets.NEXT_PUBLIC_ANALYTICS_ENABLED }} \
--set secrets.publicProxyKey=${{ secrets.NEXT_PUBLIC_ANALYTICS_ENABLED }}
--set ghcrSecret=${{ secrets.GHCR_SECRET }}
- name: Verify deployment
run: |
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/helm
.github/workflows
23 changes: 21 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
FROM node:21-alpine AS base
FROM node:21-alpine AS build

WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

ARG NEXT_PUBLIC_PROXY_KEY=redacted_next_public_proxy_key
ARG NEXT_PUBLIC_MIXPANEL_TOKEN=redacted_next_public_mixpanel_token
ARG NEXT_PUBLIC_ANALYTICS_ENABLED=false

RUN npm run format:check
RUN npm run lint
RUN NEXT_PUBLIC_PROXY_KEY=${NEXT_PUBLIC_PROXY_KEY} \
NEXT_PUBLIC_MIXPANEL_TOKEN=${NEXT_PUBLIC_MIXPANEL_TOKEN} \
NEXT_PUBLIC_ANALYTICS_ENABLED=${NEXT_PUBLIC_ANALYTICS_ENABLED} \
npm run build


FROM node:21-alpine AS runtime

WORKDIR /app
COPY --from=build /app/.next ./.next
COPY package*.json ./

RUN npm install #--omit=dev

EXPOSE 3000
CMD ["npm", "start"]
6 changes: 0 additions & 6 deletions helm/app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ spec:
value: {{ .Values.deployEnv }}
- name: APP_VERSION
value: {{ .Values.appVersion | quote }}
- name: NEXT_PUBLIC_PROXY_KEY
value: {{ .Values.secrets.publicProxyKey | quote }}
- name: NEXT_PUBLIC_MIXPANEL_TOKEN
value: {{ .Values.secrets.publicMixPanelToken | quote }}
- name: NEXT_PUBLIC_ANALYTICS_ENABLED
value: {{ .Values.secrets.publicProxyKey | quote }}
ports:
- containerPort: {{ .Values.containerPort }}
resources:
Expand Down
6 changes: 0 additions & 6 deletions helm/app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,3 @@ certIssuingMode: false
# http
publicService: true
sslRedirect: false


secrets:
publicProxyKey: ""
publicMixPanelToken: ""
secrets.publicProxyKey: ""
6 changes: 4 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@
"lint-staged": "^15.2.10",
"monaco-editor-webpack-plugin": "^7.0.1",
"next-transpile-modules": "^10.0.0",
"prettier": "^3.3.2"
"prettier": "^3.3.3"
}
}

0 comments on commit 58558f7

Please sign in to comment.