Skip to content

Commit

Permalink
feat: Implement CI/CD using Github Actions for lin
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] authored Oct 1, 2023
1 parent 66166b8 commit 9e50dde
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI/CD

on: [push, pull_request]

permissions: read-all

jobs:
setup:
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 dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
lint:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run flake8
run: |
pip install flake8
flake8 . || true
build:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Django app
run: |
python manage.py migrate
python manage.py collectstatic --noinput
push:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/djangoline:latest

0 comments on commit 9e50dde

Please sign in to comment.