finalize repo #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
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 Code | |
run: pylint app/**/*.py | |
- name: Run Unit Tests | |
run: pytest tests/ | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
tags: user/repository:latest | |
push: true | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to Kubernetes | |
uses: azure/k8s-deploy@v1 | |
with: | |
manifests: | | |
deployment/kubernetes/deployment.yml | |
deployment/kubernetes/service.yml |