Skip to content

Commit

Permalink
update github action
Browse files Browse the repository at this point in the history
  • Loading branch information
peteski22 committed Nov 18, 2024
1 parent eaf7317 commit 884d4bb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build_images_uv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
fetch-depth: 0

- name: Check modified paths
id: modified-paths
run: |
if git diff --name-only ${{ github.event.before }} ${{ github.event.pull_request.head.sha }} | grep -E '^lumigator/|^\.github/'; then
echo "Changes detected. Rebuilding image..."
Expand All @@ -32,28 +33,28 @@ jobs:
echo "is_image_build_required=$is_image_build_required" >> $GITHUB_OUTPUT
- name: Get repo version
if: ${{ steps.vars.outputs.is_image_build_required }}
if: ${{ steps.modified-paths.outputs.is_image_build_required }}
run: |
echo "REPOVERSION=$(git describe --tags --dirty --match \"[0-9\.]*\" --always)" >> $GITHUB_ENV
echo "Version of the repo for this build: $REPOVERSION"
- name: Set up QEMU
if: ${{ steps.vars.outputs.is_image_build_required }}
if: ${{ steps.modified-paths.outputs.is_image_build_required }}
uses: docker/setup-qemu-action@v3

- name: Set up Docker buildx
if: ${{ steps.vars.outputs.is_image_build_required }}
if: ${{ steps.modified-paths.outputs.is_image_build_required }}
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
if: ${{ steps.vars.outputs.is_image_build_required && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
if: ${{ steps.modified-paths.outputs.is_image_build_required && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
if: ${{ steps.vars.outputs.is_image_build_required }}
if: ${{ steps.modified-paths.outputs.is_image_build_required }}
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
Expand Down

0 comments on commit 884d4bb

Please sign in to comment.