diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a45b8a7..95606bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - build - test - lint + - deploy javascript build: image: node:12 @@ -84,3 +85,24 @@ python linting: - isort -rc src/ --check-only - black -l 88 --check src/ - autoflake --check --remove-all-unused-imports --ignore-init-module-imports --recursive src/ + +deploy: + stage: deploy + image: debian:buster + environment: + name: production + url: rss.fudiggity.nl + before_script: + - apt-get update && apt-get install -y ansible + - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@git.fudiggity.nl/sonny/ansible-playbooks.git deployment + - echo $DEPLOY_HOST > deployment/hosts.yml + - echo $DEPLOY_KEY > deployment/deploy_key + script: + - ansible-playbook deployment/playbook.yml \ + --inventory deployment/hosts.yml \ + --limit newsreader \ + --user ansible \ + --private-key deployment/deploy_key + when: manual + only: + - development