mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-10 19:53:18 +03:30
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
362eeaecb1 | ||
|
|
a048dea2a8 | ||
|
|
494ef34940 | ||
|
|
1ffe7b48d2 | ||
|
|
ed438ecf73 | ||
|
|
bcd2778538 | ||
|
|
6d786879c7 | ||
|
|
f3b54faac7 | ||
|
|
2f679b034e | ||
|
|
76395401bd | ||
|
|
bbb38b6738 | ||
|
|
c64ec3c997 | ||
|
|
e5bff5fd6e | ||
|
|
bd97db254e | ||
|
|
9f17ca4c4a |
@@ -1,4 +1,4 @@
|
|||||||
name: Balout-Admin-Publish
|
name: CSSD-Front-Publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -9,6 +9,9 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: Run Publish Job
|
name: Run Publish Job
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: git.meshkee.com/packages/ubuntu:22.04
|
||||||
|
options: --privileged
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -19,13 +22,13 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: https://git.meshkee.com/actions/checkout@main
|
||||||
|
|
||||||
- name: Setup Docker buildx
|
- name: Setup Docker buildx
|
||||||
uses: docker/setup-buildx-action@v2.10.0
|
uses: https://git.meshkee.com/actions/setup-buildx-action@master
|
||||||
|
|
||||||
- name: Log into registry git.meshkee.com
|
- name: Log into registry git.meshkee.com
|
||||||
uses: docker/login-action@v2.2.0
|
uses: https://git.meshkee.com/actions/login-action@master
|
||||||
with:
|
with:
|
||||||
registry: git.meshkee.com
|
registry: git.meshkee.com
|
||||||
username: ${{ vars.DOCKER_USERNAME }}
|
username: ${{ vars.DOCKER_USERNAME }}
|
||||||
@@ -33,7 +36,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
id: build-and-push
|
id: build-and-push
|
||||||
uses: docker/build-push-action@v4.2.1
|
uses: https://git.meshkee.com/actions/build-push-action@master
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
@@ -44,6 +47,40 @@ jobs:
|
|||||||
secrets: |
|
secrets: |
|
||||||
gitea_token=${{ secrets.TOKEN }}
|
gitea_token=${{ secrets.TOKEN }}
|
||||||
|
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
name: Deploy Job
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build # Recommended: ensures deploy only runs if build succeeds
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
actions: read
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Deploy to server via native SSH
|
||||||
|
run: |
|
||||||
|
# 1. Setup SSH directory
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
chmod 700 ~/.ssh
|
||||||
|
|
||||||
|
# 2. Add host to known_hosts to bypass prompt
|
||||||
|
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
# 3. Setup the private key
|
||||||
|
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
|
||||||
|
# 4. Connect and execute commands
|
||||||
|
ssh -i ~/.ssh/id_rsa ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'EOF'
|
||||||
|
cd /apps/admin-front
|
||||||
|
docker pull git.meshkee.com/${{ gitea.repository }}:${{ gitea.ref_name }}
|
||||||
|
IMAGE=git.meshkee.com/${{ gitea.repository }}:${{ gitea.ref_name }} docker compose up -d
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
# deploy:
|
# deploy:
|
||||||
# name: Deploy Job
|
# name: Deploy Job
|
||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
@@ -56,7 +93,7 @@ jobs:
|
|||||||
|
|
||||||
# steps:
|
# steps:
|
||||||
# - name: Deploy to server
|
# - name: Deploy to server
|
||||||
# uses: appleboy/ssh-action@v1.0.0
|
# uses: https://git.meshkee.com/actions/ssh-action@master
|
||||||
# with:
|
# with:
|
||||||
# host: ${{ secrets.SSH_HOST }}
|
# host: ${{ secrets.SSH_HOST }}
|
||||||
# username: ${{ secrets.SSH_USER }}
|
# username: ${{ secrets.SSH_USER }}
|
||||||
|
|||||||
+10
-11
@@ -1,4 +1,7 @@
|
|||||||
FROM --platform=linux/amd64 git.meshkee.com/packages/node:14 AS build-stage
|
# Build Stage
|
||||||
|
#FROM docker.meshkee.com/repository/docker-hosted/node:22-alpine as build-stage
|
||||||
|
#FROM --platform=linux/amd64 git.meshkee.com/cssd/cssd-front:1.0.2 AS build-stage
|
||||||
|
FROM git.meshkee.com/packages/node:14 AS build-stage
|
||||||
|
|
||||||
ARG REGISTRY_TOKEN
|
ARG REGISTRY_TOKEN
|
||||||
|
|
||||||
@@ -8,23 +11,19 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
RUN npm config set _auth=$REGISTRY_TOKEN
|
RUN npm config set registry=https://npm.parmincloud.ir
|
||||||
|
#
|
||||||
|
# RUN npm config set //repo.meshkee.com/repository/:_auth=$REGISTRY_TOKEN
|
||||||
|
|
||||||
RUN npm config set strict-ssl=false
|
RUN npm config set strict-ssl=false
|
||||||
|
|
||||||
RUN npm cache clean --force
|
RUN npm install
|
||||||
|
|
||||||
RUN npm i
|
|
||||||
|
|
||||||
COPY ./ .
|
COPY ./ .
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# production stage
|
EXPOSE 3000
|
||||||
FROM nginx as production-stage
|
|
||||||
|
|
||||||
RUN mkdir /app
|
CMD [ "node", ".output/server/index.mjs" ]
|
||||||
|
|
||||||
COPY --from=build-stage /app/dist /app
|
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
|
||||||
Reference in New Issue
Block a user