From d3864b9f359062071f84e293f35d61e86f7e37ac Mon Sep 17 00:00:00 2001 From: syafiqparadisam Date: Mon, 4 Nov 2024 15:34:13 +0700 Subject: [PATCH] haruse bener iki --- .github/workflows/cicd.yml | 6 +----- project/Dockerfile | 13 ++++--------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index dfbf96b..f921bd8 100755 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -64,8 +64,4 @@ jobs: with: context: "{{defaultContext}}:project" push: true - tags: ${{secrets.DOCKER_USERNAME}}/portofolio:${{secrets.DOCKER_PORTOFOLIO_TAGS_APP}} - build-args: - VITE_SERVICE_ID=${{secrets.VITE_SERVICE_ID}} - VITE_PUBLIC_KEY=${{secrets.VITE_PUBLIC_KEY}} - VITE_TEMPLATE_ID=${{secrets.VITE_TEMPLATE_ID}} \ No newline at end of file + tags: ${{secrets.DOCKER_USERNAME}}/portofolio:${{secrets.DOCKER_PORTOFOLIO_TAGS_APP}} \ No newline at end of file diff --git a/project/Dockerfile b/project/Dockerfile index d6b64a3..7cb533d 100755 --- a/project/Dockerfile +++ b/project/Dockerfile @@ -1,5 +1,5 @@ # Use base image from nodejs alpine -FROM node:20.12-alpine AS build +FROM node:21-alpine AS build # Set workdir in docker container WORKDIR /app @@ -12,15 +12,10 @@ RUN npm install # Copy source code COPY . . -# Definisikan argumen build -ARG VITE_SERVICE_ID -ARG VITE_TEMPLATE_ID -ARG VITE_PUBLIC_KEY - # Set environment variable dari argumen -ENV VITE_SERVICE_ID=$VITE_SERVICE_ID -ENV VITE_PUBLIC_KEY=$VITE_PUBLIC_KEY -ENV VITE_TEMPLATE_ID=$VITE_TEMPLATE_ID +ENV VITE_SERVICE_ID="MY_APP_SERVICE_ID" +ENV VITE_PUBLIC_KEY="MY_APP_PUBLIC_KEY" +ENV VITE_TEMPLATE_ID="MY_APP_TEMPLATE_ID" RUN npm run build