From 9058a69f3a261ad30798274f946ca3703d1ac540 Mon Sep 17 00:00:00 2001 From: Vlad Chikov Date: Sun, 25 Feb 2024 23:02:06 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20Continuous=20Deployment=20=D0=B2=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B5=D0=BA=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/actions.yml | 37 +++++++++++++++++++++++++++++++++++ .gitignore | 1 + README.md | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 .github/workflows/actions.yml create mode 100644 .gitignore diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 0000000..92600bc --- /dev/null +++ b/.github/workflows/actions.yml @@ -0,0 +1,37 @@ +name: CD Action +run-name: CD Action in work + +on: # запускать процессы при push и pull_request в ветку main + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + job: # эта часть отвечает за развёртывание приложения + name: Continuous Deployment + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + runs-on: ubuntu-latest + strategy: + matrix: + node-version: ["21.x"] + steps: + - name: Проверяем код репозитория + uses: actions/checkout@v4 + + - name: Настраиваем Node.js версии ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Устанавливаем SSH ключи + run: | + set -eu + mkdir "$HOME/.ssh" + echo "${{ secrets.DEPLOY_SSH_KEY }}" >> "$HOME/.ssh/id_rsa" + chmod 600 "$HOME/.ssh/id_rsa" + + - name: Отправляем код на сервер + run: scp -i $HOME/.ssh/id_rsa -o StrictHostKeyChecking=no -r /home/runner/work/parallax-test/parallax-test/* ${{ secrets.DEPLOY_SERVER_INFO }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md index 68eaa97..4e7c845 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![CD Action](https://github.com/vladosrus/parallax-test/actions/workflows/actions.yml/badge.svg?event=push) + # Проект: «Изучение Parallax-эффектов в веб-дизайне» ### Описание проекта