From af0d58fe4b0d0289ab59253f74f253f8757a98a6 Mon Sep 17 00:00:00 2001 From: Luke R Date: Thu, 2 May 2024 12:27:34 -0700 Subject: [PATCH] check if python was changed --- .gitea/workflows/build-and-push.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.gitea/workflows/build-and-push.yaml b/.gitea/workflows/build-and-push.yaml index 04cd7b18..2d82769d 100755 --- a/.gitea/workflows/build-and-push.yaml +++ b/.gitea/workflows/build-and-push.yaml @@ -7,17 +7,27 @@ jobs: runs-on: ubuntu-latest steps: - run: echo "This is run ${{ gitea.run_id }}" + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + python_files: + - 'app/**/*.py' + # run only if python file were changed # - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" # - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - name: Check out repository code uses: actions/checkout@v4 + if: steps.filter.outputs.workflows == 'true' - name: install UV run: | pip install uv --quiet + if: steps.filter.outputs.workflows == 'true' - name: install black and lint code run: | uv pip install black --system --quiet black app --check --fast + if: steps.filter.outputs.workflows == 'true' Build-and-Push-Docker: steps: - name: Login to Docker Hub @@ -26,6 +36,8 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} + - name: Check out repository code + uses: actions/checkout@v4 - name: Build and push uses: docker/build-push-action@v5 with: