ci: add build automation
continuous-integration/drone/tag Build is failing
Details
continuous-integration/drone/tag Build is failing
Details
parent
22ac2da7a1
commit
7ba2065e46
|
@ -0,0 +1,25 @@
|
|||
kind: pipeline
|
||||
type: docker
|
||||
name: build
|
||||
steps:
|
||||
- name: production-offline
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: registry.eigen.co.id
|
||||
repo: registry.eigen.co.id/eigen/${DRONE_REPO_NAME}-production-offline
|
||||
tags: ${DRONE_TAG}
|
||||
build_args:
|
||||
- env_target=env.production-offline
|
||||
- release_version=${DRONE_TAG}
|
||||
- name: production-online
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: registry.eigen.co.id
|
||||
repo: registry.eigen.co.id/eigen/${DRONE_REPO_NAME}-production-online
|
||||
tags: ${DRONE_TAG}
|
||||
build_args:
|
||||
- env_target=env.production-online
|
||||
- release_version=${DRONE_TAG}
|
||||
trigger:
|
||||
ref:
|
||||
- refs/tags/*-production.*
|
|
@ -0,0 +1,25 @@
|
|||
FROM node:20-alpine as build
|
||||
|
||||
ARG env_target
|
||||
ARG release_version
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . /app/
|
||||
|
||||
COPY env/$env_target /app/.env
|
||||
|
||||
RUN echo -e "\n" >> /app/.env
|
||||
RUN echo -e "APP_VERSION=${release_version}" >> /app/.env
|
||||
|
||||
RUN yarn install
|
||||
|
||||
RUN yarn build
|
||||
|
||||
FROM nginx:1.16.0-alpine
|
||||
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
|
@ -0,0 +1,3 @@
|
|||
VITE_APP_MODE=production
|
||||
VITE_BASE_API_URL=https://api.office.weplayground.id/api
|
||||
VITE_BASE_API_REPORT_URL=https://api.office.weplayground.id/api
|
|
@ -0,0 +1,17 @@
|
|||
server {
|
||||
|
||||
listen 80;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue