forked from inno-devops-labs/S25-core-course-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cf9274
commit 20d0fb1
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Application CI | ||
|
||
on: | ||
push: | ||
|
||
env: | ||
USERNAME: voronm1522 | ||
DOCKER_IMAGE: voronm1522/devops:python-app | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.13' | ||
|
||
- name: Install dependencies and linter | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
pip install -r app_python/requirements.txt | ||
- name: Lint with flake8 | ||
run: | | ||
flake8 app_python/app.py | ||
- name: Run tests | ||
run: | | ||
python app_python/unittests.py | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ env.USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: app_python | ||
push: true | ||
tags: ${{ env.DOCKER_IMAGE }} |