diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 0e6c567..31f63b2 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -10,7 +10,7 @@ on: jobs: build-and-push: - runs-on: ubuntu-latest,linux-amd,linux-arm + runs-on: [ubuntu-latest, linux-amd, linux-arm] steps: - name: Prepare Git for SHA256 Repo run: git config --global init.defaultObjectFormat sha256 @@ -20,6 +20,9 @@ jobs: with: fetch-depth: 0 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -46,18 +49,22 @@ jobs: FILES_TO_BUILD=$(find . -maxdepth 1 -name "*.yml" -o -name "*.yaml") else echo "Push triggered. Detecting changed files..." - FILES_TO_BUILD=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -E '\.(yml|yaml)$' || true) + FILES_TO_BUILD=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} 2>/dev/null | grep -E '\.(yml|yaml)$' || true) fi + for file in $FILES_TO_BUILD; do file=$(echo "$file" | sed 's|^\./||') if [ ! -f "$file" ]; then continue; fi if [[ "$file" == .gitea/* ]]; then continue; fi filename=$(basename -- "$file") image_name="${filename%.*}" + echo "---------------------------------------------------" echo "Processing: $file -> Target: registry.chillcog.com/${image_name}:latest" echo "---------------------------------------------------" + docker buildx build \ + --platform linux/amd64,linux/arm64 \ --push \ --no-cache \ -f "$file" \