feat: add pipeline v3
This commit is contained in:
parent
8322c871af
commit
65106dea82
@ -32,24 +32,24 @@ steps:
|
|||||||
secrets: [ DEPLOY_SSH_KEY ]
|
secrets: [ DEPLOY_SSH_KEY ]
|
||||||
commands:
|
commands:
|
||||||
- echo "🚀 Deploying to $DEPLOY_HOST ..."
|
- echo "🚀 Deploying to $DEPLOY_HOST ..."
|
||||||
- apk add --no-cache openssh-client docker-cli
|
- apk add --no-cache openssh-client docker-cli
|
||||||
# Setup SSH key
|
# Setup SSH key
|
||||||
- mkdir -p ~/.ssh
|
- mkdir -p ~/.ssh
|
||||||
- echo "$DEPLOY_SSH_KEY" > ~/.ssh/id_rsa
|
- echo "$DEPLOY_SSH_KEY" > ~/.ssh/id_rsa
|
||||||
- chmod 600 ~/.ssh/id_rsa
|
- chmod 600 ~/.ssh/id_rsa
|
||||||
# Add host to known_hosts to prevent prompt
|
# Add host to known_hosts to prevent prompt
|
||||||
- ssh-keyscan -p $DEPLOY_PORT $DEPLOY_HOST >> ~/.ssh/known_hosts
|
- ssh-keyscan -p $DEPLOY_PORT $DEPLOY_HOST >> ~/.ssh/known_hosts
|
||||||
# Run deployment commands remotely
|
# Run deployment commands remotely
|
||||||
- >
|
- >
|
||||||
ssh -p $DEPLOY_PORT $DEPLOY_USER@$DEPLOY_HOST "
|
ssh -p $DEPLOY_PORT $DEPLOY_USER@$DEPLOY_HOST "
|
||||||
docker pull $IMAGE &&
|
docker pull $IMAGE &&
|
||||||
docker stop manga-matcher || true &&
|
docker stop manga-matcher || true &&
|
||||||
docker rm manga-matcher || true &&
|
docker rm manga-matcher || true &&
|
||||||
docker run -d
|
docker run -d
|
||||||
--name manga-matcher
|
--name manga-matcher
|
||||||
--restart always
|
--restart always
|
||||||
-p 8000:8000
|
-p 8000:8000
|
||||||
$IMAGE
|
$IMAGE
|
||||||
"
|
"
|
||||||
when:
|
when:
|
||||||
event: [ push, pull_request ]
|
event: [ push, pull_request ]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user