From 4a69488ebf94f851ef2dedcdb03642ed7ff2396a Mon Sep 17 00:00:00 2001 From: kromskii2 <146603192+kromskii2@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:55:01 +0700 Subject: [PATCH] Update pylint.yml --- .github/workflows/pylint.yml | 83 +++++++++++++++++++++++++++++------- 1 file changed, 67 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 7c6ba98..16f18cb 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -1,27 +1,78 @@ -name: Pylint +name: CI/CD Workflow -on: [push] +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: "0 2 * * 1-5" + workflow_dispatch: jobs: build: + name: Build and Test runs-on: ubuntu-latest + strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] + node_version: ['18.x', '20.x'] + os: [ubuntu-latest, windows-latest, macos-latest] + steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 with: - python-version: ${{ matrix.python-version }} + node-version: ${{ matrix.node_version }} + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm test + + deploy: + name: Deploy to Staging + runs-on: ubuntu-22.04 + needs: build + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Deploy run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install pylint - - name: Verify installed packages - run: | - pip list - - name: Analysing the code with pylint - run: | - pylint $(git ls-files '*.py') + echo "Deploying to staging..." + # Ваши команды для деплоя + + docker: + name: Build and Push Docker Image + runs-on: ubuntu-22.04 + needs: build + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + push: true + tags: your-dockerhub-username/your-repo:tag + + - name: Docker logout + run: docker logout