Skip to content
name: Build and push Docker image
on: push
jobs:
docker:
#if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: install poetry
run: pip install poetry
- name: Check for pyproject.toml update
id: check-for-update
run: |
if git diff HEAD~ pyproject.toml | grep -P '\+version = "(v\d+\.\d+)"'; then
echo version=$(git diff HEAD~ pyproject.toml | grep -P '\+version = "(v\d+\.\d+)"' | grep -oP 'v\d+\.\d+') >> "$GITHUB_OUTPUT"
else
echo version=skip >> $GITHUB_OUTPUT
- name: Set up QEMU
if: ${{ steps.id.check-for-update.output.version != "skip"}}

Check failure on line 22 in .github/workflows/build-and-push.yml

View workflow run for this annotation

GitHub Actions / Build and push Docker image

Invalid workflow file

The workflow is not valid. .github/workflows/build-and-push.yml (Line: 22, Col: 13): Unexpected symbol: '"skip"'. Located at position 45 within expression: steps.id.check-for-update.output.version != "skip" .github/workflows/build-and-push.yml (Line: 25, Col: 13): Unexpected symbol: '"skip"'. Located at position 45 within expression: steps.id.check-for-update.output.version != "skip"
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: ${{ steps.id.check-for-update.output.version != "skip"}}
uses: docker/setup-buildx-action@v3
#- name: Login to Docker Hub
# if: ${{ steps.id.check-for-update.output.version != "skip"}}
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
#- name: Build and push
# if: ${{ steps.id.check-for-update.output.version != "skip"}}
# uses: docker/build-push-action@v6
# with:
# push: true
# tags: user/app:latest