SHA256
Update .gitea/workflows/deploy.yml
This commit is contained in:
1 parent
38760612fa
commit
442925ed8c
1 file changed
+9
-2
@@ -10,7 +10,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest,linux-amd,linux-arm
|
runs-on: [ubuntu-latest, linux-amd, linux-arm]
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare Git for SHA256 Repo
|
- name: Prepare Git for SHA256 Repo
|
||||||
run: git config --global init.defaultObjectFormat sha256
|
run: git config --global init.defaultObjectFormat sha256
|
||||||
@@ -20,6 +20,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
@@ -46,18 +49,22 @@ jobs:
|
|||||||
FILES_TO_BUILD=$(find . -maxdepth 1 -name "*.yml" -o -name "*.yaml")
|
FILES_TO_BUILD=$(find . -maxdepth 1 -name "*.yml" -o -name "*.yaml")
|
||||||
else
|
else
|
||||||
echo "Push triggered. Detecting changed files..."
|
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
|
fi
|
||||||
|
|
||||||
for file in $FILES_TO_BUILD; do
|
for file in $FILES_TO_BUILD; do
|
||||||
file=$(echo "$file" | sed 's|^\./||')
|
file=$(echo "$file" | sed 's|^\./||')
|
||||||
if [ ! -f "$file" ]; then continue; fi
|
if [ ! -f "$file" ]; then continue; fi
|
||||||
if [[ "$file" == .gitea/* ]]; then continue; fi
|
if [[ "$file" == .gitea/* ]]; then continue; fi
|
||||||
filename=$(basename -- "$file")
|
filename=$(basename -- "$file")
|
||||||
image_name="${filename%.*}"
|
image_name="${filename%.*}"
|
||||||
|
|
||||||
echo "---------------------------------------------------"
|
echo "---------------------------------------------------"
|
||||||
echo "Processing: $file -> Target: registry.chillcog.com/${image_name}:latest"
|
echo "Processing: $file -> Target: registry.chillcog.com/${image_name}:latest"
|
||||||
echo "---------------------------------------------------"
|
echo "---------------------------------------------------"
|
||||||
|
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
--push \
|
--push \
|
||||||
--no-cache \
|
--no-cache \
|
||||||
-f "$file" \
|
-f "$file" \
|
||||||
|
|||||||
Reference in new issue
Block a user