Add Docker build and Drone frontend deployment
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
c19a9763a9
commit
b60bd3c0b9
|
|
@ -0,0 +1,6 @@
|
||||||
|
.git
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
*.log
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: Deploy frontend
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Build and push image
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
registry: git.midastix.com
|
||||||
|
repo: git.midastix.com/ci-docker-repo-user/mani-agro-frontend
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: Deploy website
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
settings:
|
||||||
|
host: maniagroexports.midastix.com
|
||||||
|
port: 22
|
||||||
|
username: mani-agro-frontend
|
||||||
|
fingerprint: SHA256:z2qkspOCs67OZnm7jfrQRskZAyFSivzWiuZnxbsrhgo
|
||||||
|
key:
|
||||||
|
from_secret: server_ssh_pkey
|
||||||
|
command_timeout: 5m
|
||||||
|
script:
|
||||||
|
- sudo -n /opt/deployable/mani-agro-frontend/docker/deploy.sh
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
FROM node:24-bookworm-slim AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM alpine:3.22
|
||||||
|
COPY --from=build /app/dist /app/dist
|
||||||
Loading…
Reference in New Issue