diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1c3e6b..5e2de86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,25 +18,35 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip --no-cache-dir pip install flake8 ruff isort --no-cache-dir if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Git Clone Action - uses: actions/checkout@v2 - with: - repository: ${{ github.repository }} - path: backend/ + - name: Run flake8 run: | # stop the build if there are Python syntax errors or undefined names flake8 backend --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings flake8 backend --count --exit-zero --max-complexity=10 --max-line-length=79 --statistics --config=setup.cfg + - name: Run ruff run: | python -m ruff check . + - name: Run isort run: | isort -c . + + - name: Send report + uses: appleboy/telegram-action@master + with: + fail_ci_if_error: true + to: ${{ secrets.A_TG_TO }} + token: ${{ secrets.A_TG_TOKEN }} + message: | + В репозитории {{ github.repository }} проверка кода прошла + успешно. + Данные: {{ fail_ci_if_error }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a4f8294..044bd7f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,10 +41,6 @@ jobs: name: Push frontend Docker image to DockerHub runs-on: ubuntu-latest steps: - - name: Check out the repo - uses: actions/checkout@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - name: Login to Docker uses: docker/login-action@v2 with: @@ -53,7 +49,7 @@ jobs: - name: Push to DockerHub uses: docker/build-push-action@v4 with: - context: git@github.com:volunteers-for-city-projects/volunteers-frontend.git#deployDocker + context: https://github.com/volunteers-for-city-projects/volunteers-frontend.git#develop push: true tags: ${{ secrets.DOCKER_USERNAME }}/volunteers_frontend:latest @@ -84,7 +80,8 @@ jobs: needs: # Дождёмся билда всех образов - build_backend_and_push_to_docker_hub - # - build_frontend_and_push_to_docker_hub + - build_frontend_and_push_to_docker_hub + - build_gateway_and_push_to_docker_hub steps: - name: Checkout repo uses: actions/checkout@v3 diff --git a/backend/backend/settings.py b/backend/backend/settings.py index 951ef48..f20fb89 100644 --- a/backend/backend/settings.py +++ b/backend/backend/settings.py @@ -50,7 +50,6 @@ 'projects.apps.ProjectsConfig', 'users.apps.UsersConfig', 'corsheaders', - 'check.apps.CheckConfig', ] MIDDLEWARE = [ diff --git a/infra_bt/docker-compose.yml b/infra_bt/docker-compose.yml index c01310f..fa537b3 100644 --- a/infra_bt/docker-compose.yml +++ b/infra_bt/docker-compose.yml @@ -49,7 +49,7 @@ services: frontend: build: - context: https://github.com/volunteers-for-city-projects/volunteers-frontend.git#feature/deployDocker + context: https://github.com/volunteers-for-city-projects/volunteers-frontend.git#develop command: - /bin/sh - -c diff --git a/infra_bt/nginx.conf b/infra_bt/nginx.conf index 326e8a2..95b2940 100644 --- a/infra_bt/nginx.conf +++ b/infra_bt/nginx.conf @@ -1,5 +1,6 @@ server { listen 80; + server_tokens off; root /usr/share/nginx/html; @@ -21,8 +22,8 @@ server { } location / { - index index.html index.htm; - try_files $uri /index.html; + limit_except GET POST; + try_files $uri $uri/ =404; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;