From be6957eeee89b4a9075624e3fe47ca69be92e733 Mon Sep 17 00:00:00 2001 From: Dmitry Titenkov Date: Mon, 16 Feb 2026 14:17:14 +0300 Subject: [PATCH] ci_push_to_dockerhub --- .github/workflows/main.yml | 62 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3cdbb39..3bec1c5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,10 @@ name: Satire Pulp parser -on: [push] +on: + push: + branches: + - "**" + pull_request: jobs: lint: @@ -51,4 +55,58 @@ jobs: run: pip install -r requirements.txt - name: Run Pytest - run: pytest -v \ No newline at end of file + run: pytest -v + + push_branch_dev_to_docker_hub: + name: Build and Push Docker(dev) + runs-on: ubuntu-latest + needs: lint + + if: github.ref == 'refs/heads/dev' + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Push to Docker Hub + uses: docker/build-push-action@v5 + with: + push: true + tags: | + dmsn/satire_pulp_parser:dev + + push_branch_main_to_docker_hub: + name: Build and Push Docker(prod) + runs-on: ubuntu-latest + needs: lint + + if: github.ref == 'refs/heads/main' + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Push to Docker Hub + uses: docker/build-push-action@v5 + with: + push: true + tags: | + dmsn/satire_pulp_parser:prod