chore(pipeline): migrating from woodpecker ci/cd to komodo stack deployment
This commit is contained in:
parent
5a06d2d738
commit
2b0f63b9ac
@ -1,61 +0,0 @@
|
||||
# .pipeline.yml
|
||||
# -----------------
|
||||
|
||||
when:
|
||||
event: [ push, pull_request ]
|
||||
|
||||
steps:
|
||||
- name: publish-image
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
platforms: linux/amd64
|
||||
repo: git.badger-pirarucu.ts.net/mangamochi/frontend
|
||||
registry: git.badger-pirarucu.ts.net
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
username:
|
||||
from_secret: DOCKER_USER
|
||||
password:
|
||||
from_secret: DOCKER_PASSWORD
|
||||
build_args:
|
||||
VITE_API_BASE_URL:
|
||||
from_secret: NEXT_PUBLIC_API_BASE_URL
|
||||
VITE_OMV_BASE_URL:
|
||||
from_secret: NEXT_PUBLIC_OMV_BASE_URL
|
||||
tags:
|
||||
- latest
|
||||
- ${CI_COMMIT_SHA}
|
||||
when:
|
||||
event: [ push ]
|
||||
branch: [ main ]
|
||||
|
||||
- name: deploy
|
||||
depends_on: [ publish-image ]
|
||||
image: alpine:3.20
|
||||
environment:
|
||||
DEPLOY_USER: rov
|
||||
DEPLOY_HOST: mangamochi.badger-pirarucu.ts.net
|
||||
DEPLOY_PORT: 22
|
||||
IMAGE: git.badger-pirarucu.ts.net/mangamochi/frontend:${CI_COMMIT_SHA}
|
||||
DEPLOY_SSH_KEY:
|
||||
from_secret: DEPLOY_SSH_KEY
|
||||
commands:
|
||||
- echo "🚀 Deploying Next.js app to $DEPLOY_HOST...."
|
||||
- apk add --no-cache openssh-client docker-cli
|
||||
- mkdir -p ~/.ssh
|
||||
- echo "$DEPLOY_SSH_KEY" > ~/.ssh/id_rsa
|
||||
- chmod 600 ~/.ssh/id_rsa
|
||||
- ssh-keyscan -p $DEPLOY_PORT $DEPLOY_HOST >> ~/.ssh/known_hosts
|
||||
- >
|
||||
ssh -p $DEPLOY_PORT $DEPLOY_USER@$DEPLOY_HOST "
|
||||
docker pull $IMAGE &&
|
||||
docker stop mangamochi-frontend 2>/dev/null || true &&
|
||||
docker rm mangamochi-frontend 2>/dev/null || true &&
|
||||
docker run -d --name mangamochi-frontend \
|
||||
--restart always \
|
||||
-p 80:80 \
|
||||
$IMAGE
|
||||
"
|
||||
when:
|
||||
event: [ push ]
|
||||
branch: [ main ]
|
||||
Loading…
x
Reference in New Issue
Block a user