check if python was changed
Some checks failed
Build and push / Lint-Python (push) Failing after 6s
Build and push / Build-and-Push-Docker (push) Failing after 14s

This commit is contained in:
Luke R 2024-05-02 12:27:34 -07:00
parent 52f42cefce
commit af0d58fe4b

View File

@ -7,17 +7,27 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- run: echo "This is run ${{ gitea.run_id }}" - 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 "🐧 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 }}." # - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4 uses: actions/checkout@v4
if: steps.filter.outputs.workflows == 'true'
- name: install UV - name: install UV
run: | run: |
pip install uv --quiet pip install uv --quiet
if: steps.filter.outputs.workflows == 'true'
- name: install black and lint code - name: install black and lint code
run: | run: |
uv pip install black --system --quiet uv pip install black --system --quiet
black app --check --fast black app --check --fast
if: steps.filter.outputs.workflows == 'true'
Build-and-Push-Docker: Build-and-Push-Docker:
steps: steps:
- name: Login to Docker Hub - name: Login to Docker Hub
@ -26,6 +36,8 @@ jobs:
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }} password: ${{ secrets.DOCKER_TOKEN }}
- name: Check out repository code
uses: actions/checkout@v4
- name: Build and push - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with: