auth media
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
.idea/
|
.idea/
|
||||||
*.iml
|
*.iml
|
||||||
authid.txt
|
authid.txt
|
||||||
|
vps-config-docs.txt
|
||||||
auth-view/node_modules/
|
auth-view/node_modules/
|
||||||
auth-view/dist/
|
auth-view/dist/
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- publish
|
- publish
|
||||||
@@ -110,6 +111,26 @@ build-analytics-view:
|
|||||||
changes:
|
changes:
|
||||||
- analytics-view/**/*
|
- analytics-view/**/*
|
||||||
|
|
||||||
|
build-auth-view:
|
||||||
|
stage: build
|
||||||
|
image: node:22-alpine
|
||||||
|
cache:
|
||||||
|
key: "${CI_COMMIT_REF_SLUG}-auth-view"
|
||||||
|
paths:
|
||||||
|
- auth-view/node_modules
|
||||||
|
script:
|
||||||
|
- cd auth-view
|
||||||
|
- npm ci
|
||||||
|
- npm run build
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- auth-view/dist
|
||||||
|
expire_in: 1h
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH == "main"
|
||||||
|
changes:
|
||||||
|
- auth-view/**/*
|
||||||
|
|
||||||
# ══════════════════════════════════════════════════════════
|
# ══════════════════════════════════════════════════════════
|
||||||
# PUBLISH DOCKER IMAGES
|
# PUBLISH DOCKER IMAGES
|
||||||
# ══════════════════════════════════════════════════════════
|
# ══════════════════════════════════════════════════════════
|
||||||
@@ -209,6 +230,25 @@ publish-analytics-view:
|
|||||||
changes:
|
changes:
|
||||||
- analytics-view/**/*
|
- analytics-view/**/*
|
||||||
|
|
||||||
|
publish-auth-view:
|
||||||
|
stage: publish
|
||||||
|
image: docker:27
|
||||||
|
services:
|
||||||
|
- docker:27-dind
|
||||||
|
variables:
|
||||||
|
DOCKER_TLS_CERTDIR: ""
|
||||||
|
before_script:
|
||||||
|
- echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
|
||||||
|
script:
|
||||||
|
- docker build -t $REGISTRY/auth-view:${CI_COMMIT_SHORT_SHA} -t $REGISTRY/auth-view:latest -f auth-view/docker/Dockerfile auth-view/
|
||||||
|
- docker push $REGISTRY/auth-view:${CI_COMMIT_SHORT_SHA}
|
||||||
|
- docker push $REGISTRY/auth-view:latest
|
||||||
|
needs: [build-auth-view]
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH == "main"
|
||||||
|
changes:
|
||||||
|
- auth-view/**/*
|
||||||
|
|
||||||
# ══════════════════════════════════════════════════════════
|
# ══════════════════════════════════════════════════════════
|
||||||
# DEPLOY TO VPS
|
# DEPLOY TO VPS
|
||||||
# ══════════════════════════════════════════════════════════
|
# ══════════════════════════════════════════════════════════
|
||||||
@@ -321,25 +361,24 @@ deploy-analytics-view:
|
|||||||
docker image prune -af
|
docker image prune -af
|
||||||
ENDSSH
|
ENDSSH
|
||||||
|
|
||||||
build-auth-view:
|
deploy-auth-view:
|
||||||
stage: build
|
<<: *deploy_setup
|
||||||
image: node:22-alpine
|
needs: [publish-auth-view]
|
||||||
cache:
|
|
||||||
key: "${CI_COMMIT_REF_SLUG}-auth-view"
|
|
||||||
paths:
|
|
||||||
- auth-view/node_modules
|
|
||||||
script:
|
|
||||||
- cd auth-view
|
|
||||||
- npm ci
|
|
||||||
- npm run build
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- auth-view/dist
|
|
||||||
expire_in: 1h
|
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == "main"
|
- if: $CI_COMMIT_BRANCH == "main"
|
||||||
changes:
|
changes:
|
||||||
- auth-view/**/*
|
- auth-view/**/*
|
||||||
|
script:
|
||||||
|
- |
|
||||||
|
ssh $VPS_USER@$VPS_HOST << ENDSSH
|
||||||
|
set -e
|
||||||
|
echo "$CI_REGISTRY_PASSWORD" | docker login registry.gitlab.com -u "$CI_REGISTRY_USER" --password-stdin
|
||||||
|
cd /opt/services
|
||||||
|
export CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA}
|
||||||
|
docker compose -f docker-compose.yml -f docker-compose.prod.yml pull auth-view
|
||||||
|
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d auth-view
|
||||||
|
docker image prune -af
|
||||||
|
ENDSSH
|
||||||
|
|
||||||
# Deploy all services at once (manual trigger)
|
# Deploy all services at once (manual trigger)
|
||||||
deploy-all:
|
deploy-all:
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
FROM node:22-alpine AS build
|
FROM --platform=linux/amd64 node:22-alpine AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM nginx:alpine
|
FROM --platform=linux/amd64 nginx:alpine
|
||||||
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html/auth
|
COPY --from=build /app/dist /usr/share/nginx/html/auth
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
Reference in New Issue
Block a user