Skip to content

Commit

Permalink
Create main workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Mx-Bx authored Jul 13, 2024
1 parent 3d4d1ae commit 67fb9df
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: dit-devops-project

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
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
- name: Lint with flake8
run: |
pip install flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pip install pytest
pytest
- name: Check out the repo
uses: actions/checkout@v4

- name: Login to dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push to dockerhub
uses: docker/build-push-action@v5
with:
context:
push: true
tags: barryma22/dit-devops-project:latest

0 comments on commit 67fb9df

Please sign in to comment.