From dc88b4487791c2add95aeb127921687e4ff8f045 Mon Sep 17 00:00:00 2001 From: meowsl Date: Thu, 16 May 2024 16:48:32 +0300 Subject: [PATCH] end todays tests --- .github/workflows/main.yml | 106 +++++++++++++++++++++++++++++++++++-- 1 file changed, 103 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1893223..fe794d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,107 @@ jobs: runs-on: ubuntu-latest steps: - - name: Test + - uses: actions/checkout@v4 + + - name: Set Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: Install Bandit + run: pip install bandit + + - name: Run Scan + run: bandit -r ./server -f csv -o bandit-report.csv + + - name: Upload Scan Artifact + uses: actions/upload-artifact@v4 + if: always() + with: + name: bandit-report + path: bandit-report.csv + + install-frontend: + name: Install Frontend + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - run: | + make install-frontend + yarn build + echo "Success frontend" + + install-backend: + name: Install Backend + needs: security-backend + if: success() + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Poetry + run: | + curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python - + export PATH="${PATH}:/etc/poetry/bin" + + - name: Backend-Install + run: | + make install-backend + echo "Success backend" + + build-frontend: + name: Build Frontend + needs: install-frontend + if: success() + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Build image + run: | + cd /home/runner/work/glory-trees/glory-trees + docker image build -t ghcr.io/meowsl/glory-trees:frontend -f deploy/Dockerfile.frontend . + echo "Success build image for Frontend" + + - name: Docker Login + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push Image + run: | + docker image push ghcr.io/meowsl/glory-trees:frontend + echo "Success push image" + + build-backend: + name: Build Backend + needs: install-backend + if: success() + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Build image + run: | + cd /home/runner/work/glory-trees/glory-trees + docker image build -t ghcr.io/meowsl/glory-trees:backend -f deploy/Dockerfile.backend . + echo "Success build image for Backend" + + - name: Docker Login + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push Image run: | - echo '${{ secrets.DATABASE_URL }}' - echo '${{ secrets.SITE_DOMAIN }}' + docker image push ghcr.io/meowsl/glory-trees:backend + echo "Success push image"