From 20d0fb1808705aa6ef23b0441d06dfcd4c6518cd Mon Sep 17 00:00:00 2001 From: Mikhail Voronin Date: Wed, 5 Feb 2025 23:59:10 +0300 Subject: [PATCH] Remove tag --- app_python/.github/workflows/python-app.yml | 47 +++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 app_python/.github/workflows/python-app.yml diff --git a/app_python/.github/workflows/python-app.yml b/app_python/.github/workflows/python-app.yml new file mode 100644 index 0000000000..485159aeb6 --- /dev/null +++ b/app_python/.github/workflows/python-app.yml @@ -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 }} \ No newline at end of file