24 lines
639 B
YAML
24 lines
639 B
YAML
when:
|
|
branch: main
|
|
event: push
|
|
|
|
steps:
|
|
deploy:
|
|
image: docker:cli
|
|
volumes:
|
|
- /root/lab/bytegeist-portfolio/site:/live-site
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- /root/.ssh:/root/.ssh
|
|
commands:
|
|
- apk add --no-cache git openssh-client
|
|
- mkdir -p /root/.ssh
|
|
- ssh-keyscan -p 2222 git.casko.dev >> /root/.ssh/known_hosts
|
|
- chmod 700 /root/.ssh
|
|
- chmod 600 /root/.ssh/id_ed25519
|
|
- cd /live-site
|
|
- git fetch origin main
|
|
- git reset --hard origin/main
|
|
- docker restart bytegeist-portfolio
|
|
- git log -1 --oneline
|
|
- echo "Deploy complete"
|