Skip to content

Commit

Permalink
feat: добавить Continuous Deployment для проекта
Browse files Browse the repository at this point in the history
  • Loading branch information
vladosrus committed Feb 25, 2024
1 parent 06e2922 commit c035a70
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -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/russian-travel/russian-travel/* ${{ secrets.DEPLOY_SERVER_INFO }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
![CD Action](https://github.com/vladosrus/russian-travel/actions/workflows/actions.yml/badge.svg?event=push)
# Проект: «Путешествия по России»

### Описание проекта
Expand Down

0 comments on commit c035a70

Please sign in to comment.