Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit efa51c3e authored by 65160206's avatar 65160206
Browse files

add gitlab-ci.yml

parent 8418ade1
Branches
No related tags found
No related merge requests found
Pipeline #656 canceled
stages:
- deploy
deploy_to_dekdee3:
stage: deploy
image: alpine:latest
before_script:
- apk add --no-cache openssh git
script:
# สร้าง SSH Key ชั่วคราว
- echo "$SSH_PRIVATE_KEY" > id_ed25519
- chmod 600 id_ed25519
- mkdir -p ~/.ssh
- ssh-keyscan dekdee3.informatics.buu.ac.th >> ~/.ssh/known_hosts
# SSH เข้า dekdee3 และสั่ง deploy
- ssh -i id_ed25519 65160206@dekdee3.informatics.buu.ac.th '
cd ~/frontend &&
git pull &&
docker-compose down &&
docker-compose up -d --build
'
only:
- main
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment