From 65caffebd9be47cc375f23ef284dfc7cb051542c Mon Sep 17 00:00:00 2001 From: kislovdm Date: Mon, 12 Feb 2024 20:19:29 +0300 Subject: [PATCH] init --- .github/workflows/docker.yml | 22 +++++++++++++++++++--- .gitignore | 2 ++ docker-compose.yaml | 11 +++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 docker-compose.yaml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1fd0b36..8dc05c5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,9 +4,7 @@ name: Create and publish a Docker image on: push: branches: [ "master" ] - tags: - - '*' - + # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. env: REGISTRY: ghcr.io @@ -47,3 +45,21 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + # ------------------------ This is deploy pipeline -------------------------- + - name: Install SSH Key + #if: ${{ vars.SSH_HOST != '' }} + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_PRIVATE_KEY }} + known_hosts: 'just-a-placeholder-so-we-dont-get-errors' + - name: Adding Known Hosts + #if: ${{ vars.SSH_HOST != '' }} + run: ssh-keyscan -H ${{ vars.SSH_HOST }} >> ~/.ssh/known_hosts + - name: "Deploy to server" + #if: ${{ vars.SSH_HOST != '' }} + run: ssh monster@${{ vars.SSH_HOST }} 'cd docker.services/${{ github.event.repository.name }} && git pull && docker login ghcr.io -u ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} && docker-compose pull && docker-compose build && docker-compose up -d && docker system prune --force' + - name: Send message to Telegram + uses: Lukasss93/telegram-action@v2 + env: + TELEGRAM_TOKEN: ${{ vars.TELEGRAM_TOKEN }} + TELEGRAM_CHAT: 123622180 diff --git a/.gitignore b/.gitignore index d5526ab..bd96a0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. +settings.env + #rider .idea/ diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..0009d8b --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,11 @@ +version: '3' +services: + sibur_buggy_bot: + image: ghcr.io/monster1025/sibur_buggy_bot:master + container_name: sibur_buggy_bot + restart: always + env_file: ./settings.env + logging: + driver: json-file + options: + max-size: 50m \ No newline at end of file