Updated config.yml

This commit is contained in:
Lucy Joshua 2023-02-25 01:20:57 +02:00
parent f9087bc36c
commit 09af134de2

View file

@ -2,25 +2,32 @@
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
say-hello:
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
docker:
- image: cimg/base:stable
# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
steps:
- checkout
- run:
name: "Say hello"
command: "echo Hello, World!"
clone:
machine:
image: "ubuntu-2004:current"
steps:
- run:
name: Clone
command: ssh $SSH_USER@$SSH_HOST "cd /etc/BotYam && gh repo sync"
deploy:
machine:
image: "ubuntu-2004:current"
steps:
- run:
name: Deploy Over SSH
command: ssh $SSH_USER@$SSH_HOST "cd /etc/BotYam && docker-compose up -d --build"
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
say-hello-workflow:
jobs:
- say-hello
build-and-deploy:
jobs:
- clone:
filters:
branches:
only: main
- deploy:
requires:
- clone
filters:
branches:
only: main