test
All checks were successful
Build And Test / build-and-push (push) Successful in 1m53s

This commit is contained in:
2025-04-23 15:23:39 +09:00
parent a5d4024ede
commit 293bcdbea6
7 changed files with 53 additions and 21 deletions

2
.env.development Normal file
View File

@ -0,0 +1,2 @@
REACT_APP_API_AUTH=http://127.0.0.1:8000
REACT_APP_API_BLOG=http://127.0.0.1:8800

2
.env.production Normal file
View File

@ -0,0 +1,2 @@
REACT_APP_API_AUTH=https://www.demo.test
REACT_APP_API_BLOG=https://www.demo.test

View File

@ -25,13 +25,6 @@ jobs:
with:
path: ./version
# .env.production 생성
# URL_PROD
- name: Create env_production
# run: ${{ URL_KUBE_SVC }} > .env.production
run: ${{ URL_PROD }} > .env.production
- name: Install Docker // Docker 설치
run: |
curl -fsSL https://get.docker.com -o get-docker.sh
@ -39,7 +32,8 @@ jobs:
if: runner.os == 'Linux'
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v1
# uses: https://github.com/docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v1
- name: Login to Registry
run: docker login -u ${{ secrets.DOCKER_ID }} -p ${{ secrets.DOCKER_PW }} https://harbor.icurfer.com
@ -59,7 +53,7 @@ jobs:
- name: Checkout kustomize repository
uses: actions/checkout@v3
with:
repository: "icurfer/cd-msa-fe"
repository: "dev/cd-msa-fe"
ref: main
token: ${{ secrets.ACTION_TOKEN }}
path: cd-msa-fe
@ -67,7 +61,7 @@ jobs:
- name: Update Kubernetes resources
run: |
cd cd-msa-fe/overlays/dev/
kustomize edit set image \harbor.icurfer.com/msa-demo/msa-fe:\${{ steps.img-ver.outputs.content }}
kustomize edit set image harbor.icurfer.com/msa-demo/msa-fe:${{ steps.img-ver.outputs.content }}
cat kustomization.yaml
## cd commit

4
.gitignore vendored
View File

@ -15,10 +15,10 @@
.DS_Store
.env.local
.env.development.local
.env.development
# .env.development
.env.test.local
.env.production.local
.env.production
# .env.production
npm-debug.log*
yarn-debug.log*

View File

@ -1,10 +1,6 @@
# Build stage
FROM node:20.11 as builder
# Build arguments for React environment variables
ARG REACT_APP_API_AUTH
ARG REACT_APP_API_BLOG
# Set working directory
WORKDIR /usr/src/app
@ -17,10 +13,6 @@ RUN npm install
# Copy the rest of the application
COPY . ./
# Set env vars for React build (only works if passed as build-arg)
ENV REACT_APP_API_AUTH=$REACT_APP_API_AUTH
ENV REACT_APP_API_BLOG=$REACT_APP_API_BLOG
# Build the application
RUN npm run build

42
Dockerfile_test Normal file
View File

@ -0,0 +1,42 @@
# Build stage
FROM node:20.11 as builder
# Build arguments for React environment variables
ARG REACT_APP_API_AUTH
ARG REACT_APP_API_BLOG
# Set working directory
WORKDIR /usr/src/app
# Copy package.json and package-lock.json (if available)
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application
COPY . ./
# Set env vars for React build (only works if passed as build-arg)
ENV REACT_APP_API_AUTH=$REACT_APP_API_AUTH
ENV REACT_APP_API_BLOG=$REACT_APP_API_BLOG
# Build the application
RUN npm run build
# Production stage
FROM nginx:alpine
# Copy the build output to Nginx html directory
COPY --from=builder /usr/src/app/build /usr/share/nginx/html
# Copy Nginx configuration file
COPY nginx.conf /etc/nginx/nginx.conf
# Expose port 80
EXPOSE 80
# Start Nginx server
CMD ["nginx", "-g", "daemon off;"]
# docker build -t harbor.icurfer.com/msa-demo/msa-fe:kong-0 --build-arg REACT_APP_API_AUTH=https://www.demo.test --build-arg

View File

@ -1 +1 @@
0.0.2
0.0.4