From 2962bb9df4ed35e4489be873eeab58e865a1bfbc Mon Sep 17 00:00:00 2001 From: hazadus Date: Sat, 6 Jan 2024 16:34:27 +0300 Subject: [PATCH] ci/cd: Added GitHub Action for auto-deploy on push to main. --- .github/workflows/deploy.yml | 41 ++++++++++++++++++++++++++++++ .github/workflows/django_tests.yml | 2 +- changelog.md | 3 +++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..93d4b5e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,41 @@ +name: Continuous Integration + +on: + push: + branches: + - main + +concurrency: + group: main + cancel-in-progress: true + +jobs: + qa: + name: Django Tests + uses: ./.github/workflows/django_tests.yml + + deploy: + name: Deploy + needs: qa + runs-on: ubuntu-latest + steps: + - name: Configure SSH + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + SSH_HOST: ${{ secrets.SSH_HOST }} + SSH_USER: ${{ secrets.SSH_USER }} + run: | + mkdir -p ~/.ssh/ + echo "$SSH_PRIVATE_KEY" > ~/.ssh/github + chmod 600 ~/.ssh/github + cat >>~/.ssh/config <