Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to test: 08.2023 release #175

Merged
merged 12 commits into from
Aug 29, 2023
Merged
84 changes: 84 additions & 0 deletions .github/workflows/pr_closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: PR_CLOSED DEPLOY AND TG ALERT

on:
pull_request:
types: [closed]
branches:
- main


jobs:
build_and_push_to_docker_hub:
name: Push Docker image to Docker Hub
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
push: true
tags: lapkipomoshi/help_paw_f:latest

deploy:
runs-on: ubuntu-latest
needs: build_and_push_to_docker_hub
steps:
- name: executing remote ssh commands to deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
password: ${{ secrets.PASSWORD }}
script: |
cd ~/test
sudo docker-compose stop
rm .env
touch .env
echo DB_ENGINE=${{ secrets.DB_ENGINE }} >> .env
echo DB_NAME=${{ secrets.DB_NAME }} >> .env
echo POSTGRES_USER=${{ secrets.POSTGRES_USER }} >> .env
echo POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} >> .env
echo DB_HOST=${{ secrets.DB_HOST }} >> .env
echo DB_PORT=${{ secrets.DB_PORT }} >> .env
echo D_KEY=${{ secrets.D_KEY }} >> .env
echo LOCAL=${{ secrets.LOCAL }} >> .env
echo BOT=${{ secrets.BOT }} >> .env
echo ALERT_CHANNEL=${{ secrets.ALERT_CHANNEL }} >> .env
echo EMAIL_HOST=${{ secrets.EMAIL_HOST }} >> .env
echo EMAIL_PORT=${{ secrets.EMAIL_PORT }} >> .env
echo EMAIL_HOST_USER=${{ secrets.EMAIL_HOST_USER }} >> .env
echo EMAIL_HOST_PASSWORD=${{ secrets.EMAIL_HOST_PASSWORD }} >> .env
echo EMAIL_USE_SSL=${{ secrets.EMAIL_USE_SSL }} >> .env
echo EMAIL_USE_TLS=${{ secrets.EMAIL_USE_TLS }} >> .env
echo DEBUG=${{ secrets.DEBUG }} >> .env
echo EMAIL_BACKEND_TYPE=${{ secrets.EMAIL_BACKEND_TYPE }} >> .env
sudo docker-compose pull
sudo docker-compose up -d

send_message:
runs-on: ubuntu-latest
needs: deploy
steps:
- name: send message
if: github.event.pull_request.merged == true
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.ALERT_CHANNEL }}
token: ${{ secrets.BOT }}
message: FRONTEND - ${{ github.event_name }} ветки ${{ github.head_ref }} успешно смержен в ${{ github.base_ref }}, LAPKIPOMOSHI.RU обновлен и перезапущен
- name: send message merged
if: github.event.pull_request.merged == false
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.ALERT_CHANNEL }}
token: ${{ secrets.BOT }}
message: FRONTEND - ${{ github.event_name }} ветки ${{ github.head_ref }} в ${{ github.base_ref }} закрыт без мержа, деплой не производился.
85 changes: 85 additions & 0 deletions .github/workflows/pr_closed_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: PR_CLOSED DEPLOY AND TG ALERT

on:
pull_request:
types: [closed]
branches:
- test


jobs:
build_and_push_to_docker_hub:
name: Push Docker image to Docker Hub
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
push: true
tags: lapkipomoshi/help_paw_f:test

deploy:
runs-on: ubuntu-latest
needs: build_and_push_to_docker_hub
steps:
- name: executing remote ssh commands to deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.TEST_HOST }}
username: ${{ secrets.USER }}
password: ${{ secrets.PASSWORD }}
script: |
cd ~/test
sudo docker-compose stop
rm .env
touch .env
echo DB_ENGINE=${{ secrets.DB_ENGINE }} >> .env
echo DB_NAME=${{ secrets.DB_NAME }} >> .env
echo POSTGRES_USER=${{ secrets.POSTGRES_USER }} >> .env
echo POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} >> .env
echo DB_HOST=${{ secrets.DB_HOST }} >> .env
echo DB_PORT=${{ secrets.DB_PORT }} >> .env
echo D_KEY=${{ secrets.D_KEY }} >> .env
echo LOCAL=${{ secrets.LOCAL }} >> .env
echo BOT=${{ secrets.BOT }} >> .env
echo ALERT_CHANNEL=${{ secrets.ALERT_CHANNEL }} >> .env
echo EMAIL_HOST=${{ secrets.EMAIL_HOST }} >> .env
echo EMAIL_PORT=${{ secrets.EMAIL_PORT }} >> .env
echo EMAIL_HOST_USER=${{ secrets.EMAIL_HOST_USER }} >> .env
echo EMAIL_HOST_PASSWORD=${{ secrets.EMAIL_HOST_PASSWORD }} >> .env
echo EMAIL_USE_SSL=${{ secrets.EMAIL_USE_SSL }} >> .env
echo EMAIL_USE_TLS=${{ secrets.EMAIL_USE_TLS }} >> .env
echo DEBUG=${{ secrets.TEST_DEBUG }} >> .env
echo EMAIL_BACKEND_TYPE=${{ secrets.EMAIL_BACKEND_TYPE }} >> .env
echo REACT_APP_SERVER_TYPE=${{ secrets.REACT_APP_SERVER_TYPE_TEST }} >> .env
sudo docker-compose pull
sudo docker-compose up -d

send_message:
runs-on: ubuntu-latest
needs: deploy
steps:
- name: send message
if: github.event.pull_request.merged == true
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.ALERT_CHANNEL }}
token: ${{ secrets.BOT }}
message: FRONTEND - ${{ github.event_name }} ветки ${{ github.head_ref }} успешно смержен в ${{ github.base_ref }}, TEST обновлен и перезапущен
- name: send message merged
if: github.event.pull_request.merged == false
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.ALERT_CHANNEL }}
token: ${{ secrets.BOT }}
message: FRONTEND - ${{ github.event_name }} ветки ${{ github.head_ref }} в ${{ github.base_ref }} закрыт без мержа, деплой не производился.
19 changes: 19 additions & 0 deletions .github/workflows/pr_opened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PR_OPENED TG ALERT

on:
pull_request:
types: [opened]
branches:
- main
- test

jobs:
send_message:
runs-on: ubuntu-latest
steps:
- name: send message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.ALERT_CHANNEL }}
token: ${{ secrets.BOT }}
message: FRONTEND - ${{ github.actor }} открыл ${{ github.event_name }} ветки ${{ github.head_ref }} в ${{ github.base_ref }}
6 changes: 3 additions & 3 deletions src/components/CardsSlider/CardsSlider.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useRef } from 'react';
import './CardsSlider.scss';

const CardsSlider = ({ children, isButtonsHidden = false }) => {
const CardsSlider = ({ children, isButtonsHidden = false, modifier }) => {
const defaultScrollPixelsAmount = 350;

const sliderContainerRef = useRef(null);
Expand All @@ -16,10 +16,10 @@ const CardsSlider = ({ children, isButtonsHidden = false }) => {

return (
<>
<ul className='cards-slider' ref={sliderContainerRef}>
<ul className={`cards-slider cards-slider_${modifier}`} ref={sliderContainerRef}>
{children}
</ul>
<div className={`cards-slider__buttons ${isButtonsHidden && 'cards-slider__buttons_hidden'}`}>
<div className={`cards-slider__buttons cards-slider__buttons_${modifier} ${isButtonsHidden && 'cards-slider__buttons_hidden'}`}>
<button className='cards-slider__button' type='button' onClick={handleSliderScroll('left')} />
<button className='cards-slider__button cards-slider__button_next' type='button' onClick={handleSliderScroll('right')} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
display: none;
}

&_profile {
margin-bottom: 0;
}

@media (min-width: 768px) {
margin-bottom: 80px;

&_profile {
margin-bottom: 0;
}
}
}
20 changes: 18 additions & 2 deletions src/components/CardsSlider/styles/cards-slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,27 @@
column-gap: 38px;
overflow: hidden;

&_profile {
padding: 0;
}

@media (min-width: 768px) {
padding: 20px 0 44px 44px;
.cards-slider {
padding: 20px 0 44px 44px;

&_profile {
padding: 0;
}
}
}

@media (min-width: 1440px) {
padding-left: 132px;
.cards-slider {
padding-left: 132px;

&_profile {
padding: 0;
}
}
}
}
28 changes: 28 additions & 0 deletions src/components/PrivacyCheckbox/PrivacyCheckbox.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import { Link } from 'react-router-dom';

import './PrivacyCheckbox.scss';

const PrivacyCheckbox = ({ onClick }) => {
return (
<div className='privacy-checkbox'>
<label className='privacy-checkbox__container'>
<input className='privacy-checkbox__input' type='checkbox' onClick={onClick} />
<span className='privacy-checkbox__checkbox' />
</label>

<p className='privacy-checkbox__text standard-font standard-font_type_small'>
Я согласен с{' '}
<Link className='privacy-checkbox__link standard-font standard-font_type_small' to='/privacy' target='_blank'>
Политикой конфиденциальности
</Link>{' '}
и{' '}
<Link className='privacy-checkbox__link standard-font standard-font_type_small' to='/terms' target='_blank'>
Условиями использования сервиса
</Link>
</p>
</div>
);
};

export default PrivacyCheckbox;
52 changes: 52 additions & 0 deletions src/components/PrivacyCheckbox/PrivacyCheckbox.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.privacy-checkbox {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 18px;
position: relative;
}

.privacy-checkbox__text {
color: var(--color-text-base);
margin: 0;
width: 367px;
}

.privacy-checkbox__link {
color: var(--color-accent-base);
text-decoration: none;
}

.privacy-checkbox__checkbox:hover {
cursor: pointer;
}

.privacy-checkbox__container > .privacy-checkbox__input {
position: absolute;
z-index: -1;
opacity: 0;
}

.privacy-checkbox__container > .privacy-checkbox__checkbox {
display: inline-flex;
align-items: center;
}

.privacy-checkbox__container > .privacy-checkbox__checkbox::before {
content: '';
box-sizing: border-box;
display: inline-block;
height: 20px;
width: 20px;
border: 1px solid var(--color-text-base);
border-radius: 2px;
margin-right: 20px;
background-repeat: no-repeat;
background-position: center;
background-color: var(--color-text-light);
}

.privacy-checkbox__container > .privacy-checkbox__input:checked + .privacy-checkbox__checkbox::before {
background-image: url('../../images/register__daw.svg');
background-size: 100%;
}
2 changes: 1 addition & 1 deletion src/components/ProfileContainer/ProfileContainer.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.profile-container {
background-color: var(--color-background-base);
padding: 44px 132px 199px;
padding: 44px 132px 80px;
position: relative;

&_edit-profile {
Expand Down
Loading
Loading