From ee0f73ef64f0df26a5cffc1aa2cbf3f2d109d18b Mon Sep 17 00:00:00 2001 From: gleb Date: Mon, 30 Mar 2026 18:45:27 +0300 Subject: [PATCH 1/2] feat: unique change for PR --- app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app.py b/app.py index c398fc5..f68dcdf 100644 --- a/app.py +++ b/app.py @@ -4,3 +4,4 @@ def welcome_message(): def calculate_uptime(days): return days * 24 # Converts days to hours +print('Version 2.0') From 5ced531a5a7084c3f1d399ee79096f551027284a Mon Sep 17 00:00:00 2001 From: gleb Date: Mon, 30 Mar 2026 18:54:12 +0300 Subject: [PATCH 2/2] feat: added github actions workflow --- .github/workflows/main.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c900510 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,39 @@ +name: CI-CD Pipeline + +on: + push: + branches: [ "main", "feature/*" ] + pull_request: + branches: [ "main" ] + +jobs: + test-and-deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # --- STEP 1: UNIT TESTING --- + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install dependencies + run: pip install pytest + + - name: Run Pytest + run: pytest + + # --- STEP 2: DOCKER HUB DEPLOY (Only on Main Branch) --- + - name: Login to Docker Hub + if: github.ref == 'refs/heads/main' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push + if: github.ref == 'refs/heads/main' + run: | + docker build -t skalgleb2devops/testing:latest . + docker push skalgleb2devops/testing:latest