You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
motief/.drone.yml

38 lines
1.1 KiB

kind: pipeline
type: docker
name: default
steps:
- name: build
image: docker:24.0.2
environment:
DOCKER_BUILDKIT: "1"
commands:
- docker build -t ${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}:${DRONE_COMMIT_SHA} .
- docker tag ${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}:${DRONE_COMMIT_SHA} ${DOCKER_REGISTRY}/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}:latest
- name: push
image: docker:24.0.2
commands:
- echo "Logging into registry"
- docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} ${DOCKER_REGISTRY}
- docker push ${DOCKER_REGISTRY}/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}:${DRONE_COMMIT_SHA}
- docker push ${DOCKER_REGISTRY}/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}:latest
- name: deploy
image: appleboy/drone-ssh
settings:
host: ${DEPLOY_HOST}
port: ${DEPLOY_SSH_PORT}
username: ${DEPLOY_USER}
password: ${DEPLOY_PASSWORD}
script: |
set -e
cd /srv/stemwijzer
docker pull ${DOCKER_REGISTRY}/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}:latest
docker-compose pull
docker-compose up -d
trigger:
branch:
- main