Compare commits

..
9 Commits
2 changed files with 53 additions and 9 deletions
+37
View File
@@ -9,6 +9,9 @@ jobs:
build:
name: Run Publish Job
runs-on: ubuntu-latest
container:
image: git.meshkee.com/packages/ubuntu:22.04
options: --privileged
permissions:
contents: read
@@ -44,6 +47,40 @@ jobs:
secrets: |
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:
# name: Deploy Job
# runs-on: ubuntu-latest
+16 -9
View File
@@ -1,22 +1,29 @@
FROM git.meshkee.com/packages/node:14 AS build
# 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_PROXY
WORKDIR /app
COPY package*.json ./
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 install
COPY . .
COPY ./ .
RUN npm run build
FROM git.meshkee.com/packages/node:14 AS runtime
WORKDIR /app
COPY --from=build /app/.output .output
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]
CMD [ "node", ".output/server/index.mjs" ]