From 7e31a410520a451b2c61aa63aac50ce882d17b0c Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 23:24:11 +0000 Subject: [PATCH 1/4] feat: Add CI/CD pipeline with linting, build, and --- .github/workflows/ci_cd.yml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/ci_cd.yml diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml new file mode 100644 index 0000000..d0553a4 --- /dev/null +++ b/.github/workflows/ci_cd.yml @@ -0,0 +1,46 @@ +name: CI/CD + +on: [push, pull_request] + +permissions: read-all + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install flake8 + run: pip install flake8 + - name: Run flake8 + run: flake8 . + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install Django + run: pip install Django + - name: Run Django build + run: python manage.py check + + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Log in to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Build Docker image + run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/djangoline:latest . + - name: Push Docker image + run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/djangoline:latest || true From 1d69bed76b0eaf1150a6deefb2e150013a208854 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 23:24:49 +0000 Subject: [PATCH 2/4] feat: Add flake8 configuration --- .flake8 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..0e586ff --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +exclude = migrations,__pycache__ +max-line-length = 120 +max-complexity = 10 From ded6b39357fc9ec2d02ef740dd1848a42a13546e Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 23:26:18 +0000 Subject: [PATCH 3/4] feat: Add pre-commit configuration for flake8 --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..0a25f82 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: + - repo: https://github.com/pycqa/flake8 + rev: 3.8.4 # The version of flake8 to use + hooks: + - id: flake8 From 266f859549a8926dc385fe7df30820c219770057 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 23:26:59 +0000 Subject: [PATCH 4/4] feat: Add flake8 to requirements --- requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3930480 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +flake8