Skip to content

Commit

Permalink
ci: update env docker build (#159)
Browse files Browse the repository at this point in the history
Co-authored-by: Ilya Egorov <ilya.e@ton.org>
  • Loading branch information
Mobyman and Ilya Egorov authored Nov 21, 2024
1 parent 8fb0cec commit e45d3da
Show file tree
Hide file tree
Showing 8 changed files with 35 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.nextPublicProxyKey=${{ secrets.NEXT_PUBLIC_PROXY_KEY }} \
--set secrets.nextPublicMixpanelToken=${{ secrets.NEXT_PUBLIC_MIXPANEL_TOKEN }} \
--set secrets.nextPublicAnalyticsEnabled=${{ 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
21 changes: 19 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
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 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

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.nextPublicProxyKey | quote }}
- name: NEXT_PUBLIC_MIXPANEL_TOKEN
value: {{ .Values.secrets.nextPublicMixpanelToken | quote }}
- name: NEXT_PUBLIC_ANALYTICS_ENABLED
value: {{ .Values.secrets.nextPublicAnalyticsEnabled | 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:
nextPublicProxyKey: "redacted_proxy_key"
nextPublicMixpanelToken: "redacted_mixpanel_token"
nextPublicAnalyticsEnabled: "true"
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 e45d3da

Please sign in to comment.