Skip to content

Commit

Permalink
feat: use self-hosted. add 1m sleep.
Browse files Browse the repository at this point in the history
  • Loading branch information
pifou25 committed May 1, 2024
1 parent c21de58 commit cf66abd
Showing 1 changed file with 43 additions and 23 deletions.
66 changes: 43 additions & 23 deletions .github/workflows/buildx-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,37 @@ jobs:
# https://docs.docker.com/build/ci/github-actions/multi-platform/
# distributebuild across multiple runners
# This step build the same image on different runners / platforms
runs-on: ubuntu-latest
needs: initStep
strategy:
fail-fast: false
matrix:
debian: ["buster", "bullseye", "bookworm"]
php: [7.3, 8.1]
debian: [buster, bullseye, bookworm]
php: [7.3, 8.1, 8.2]
# linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
platform: ["amd64", "arm64", "arm/v6", "arm/v7"]
platform: [amd64, arm64, arm/v6, arm/v7]
jeedom: ["V4-stable", "beta"]
target: ["light", "full"]
xdebug: [true, false]
exclude:
# exclude PHP7.3 on every bookworm OS
- debian: "bookworm"
php: 7.3
# exclude PHP8 on every buster and bullseye OS
- debian: "buster"
php: 8.1
# exclude Jeedom beta on every buster, not supported
- debian: "buster"
jeedom: "beta"
# exclude Jeedom debug on every buster, useless
- debian: "buster"
xdebug: false
# exclude platform arm/v6 for Buster...
- debian: "buster"
platform: "arm/v6"
# exclude php version for each debian
- debian: buster
php: 8.1
- debian: buster
php: 8.2
- debian: bookworm
php: 8.1
- debian: bookworm
php: 7.3
- debian: bullseye
php: 8.2

runs-on: ${{ matrix.platform == 'arm64' && 'ARM64' || matrix.platform == 'arm/v7' && 'ARM' || 'self-hosted' }}
env:
REGISTRY_IMAGE: pifou25/jeedom
TAG_NAME: ${{ matrix.debian }}-${{ matrix.php }}${{ matrix.target == 'light' && '-light' || '' }}${{ matrix.jeedom == 'beta' && '-beta' || '' }}${{ matrix.xdebug && '-debug' || '' }}${{ github.ref_name != 'master' && '-dev' || '' }}
Expand Down Expand Up @@ -161,18 +163,25 @@ jobs:
# some debug information in case of error
run: |
echo "${{ matrix.debian }} PHP${{ matrix.php }} ${{ matrix.target }} branch ${{ matrix.jeedom }} debug ${{ matrix.xdebug }} has Errors! 🚀" >> $GITHUB_STEP_SUMMARY
echo "Cache: buildx-${{ runner.os }}-${{ matrix.platform }}-${{ matrix.debian }} hit? ${{ steps.cache.outputs.cache-hit }}"
echo "Cache: buildx-${{ runner.os }}-${{ matrix.platform }}-${{ matrix.debian }} hit? ${{ steps.cache.outputs.cache-hit }}" >> $GITHUB_STEP_SUMMARY
echo "runs on: ${{ matrix.platform == 'arm64' && 'ARM64' || matrix.platform == 'arm/v7' && 'ARM' || 'self-hosted' }}" >> $GITHUB_STEP_SUMMARY
echo "Labels: ${{ steps.meta.outputs.labels }}" >> $GITHUB_STEP_SUMMARY
-
name: Export digest ${{ env.TAG_NAME }}:${{ matrix.platform }}
# export the digest file name into env var named DIGEST-${TAG_NAME} for next step
# also add debug informations in github step summary
if: steps.buildJeedom.outcome == 'success'
run: |
mkdir -p /tmp/digests
digest="${{ steps.buildJeedom.outputs.digest }}"
echo "DIGEST=${digest#sha256:}" >> $GITHUB_ENV
touch "/tmp/digests/${digest#sha256:}"
echo "${{ matrix.debian }} PHP${{ matrix.php }} ${{ matrix.target }} branch ${{ matrix.jeedom }} debug ${{ matrix.xdebug }} has Errors! 🚀" >> $GITHUB_STEP_SUMMARY
echo "Cache: buildx-${{ runner.os }}-${{ matrix.platform }}-${{ matrix.debian }} hit? ${{ steps.cache.outputs.cache-hit }}" >> $GITHUB_STEP_SUMMARY
echo "runs on: ${{ matrix.platform == 'arm64' && 'ARM64' || matrix.platform == 'arm/v7' && 'ARM' || 'self-hosted' }}" >> $GITHUB_STEP_SUMMARY
echo "Labels: ${{ steps.meta.outputs.labels }}" >> $GITHUB_STEP_SUMMARY
-
name: Upload digest ${{ env.TAG_NAME }}:${{ matrix.platform }}
if: steps.buildJeedom.outcome == 'success'
Expand All @@ -195,26 +204,35 @@ jobs:
# same matrix as previous step except the platform
strategy:
fail-fast: false
# limit to avoid error HTTP 409: too many requests
max-parallel: 2
matrix:
debian: ["buster", "bullseye", "bookworm"]
php: [7.3, 8.1]
debian: [buster, bullseye, bookworm]
php: [7.3, 8.1, 8.2]
# linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
platform: [amd64, arm64, arm/v6, arm/v7]
jeedom: ["V4-stable", "beta"]
target: ["light", "full"]
xdebug: [true, false]
exclude:
# exclude PHP7.3 on every bookworm OS
- debian: "bookworm"
php: 7.3
# exclude PHP8 on every buster and bullseye OS
- debian: "buster"
php: 8.1
# exclude Jeedom beta on every buster, not supported
- debian: "buster"
jeedom: "beta"
# exclude Jeedom debug on every buster, useless
- debian: "buster"
xdebug: false

# exclude php version for each debian
- debian: buster
php: 8.1
- debian: buster
php: 8.2
- debian: bookworm
php: 8.1
- debian: bookworm
php: 7.3
- debian: bullseye
php: 8.2

env:
REGISTRY_IMAGE: pifou25/jeedom
TAG_NAME: ${{ matrix.debian }}-${{ matrix.php }}${{ matrix.target == 'light' && '-light' || '' }}${{ matrix.jeedom == 'beta' && '-beta' || '' }}${{ matrix.xdebug && '-debug' || '' }}${{ github.ref_name != 'master' && '-dev' || '' }}
Expand Down Expand Up @@ -279,5 +297,7 @@ jobs:
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
-
name: Inspect image ${{ env.TAG_NAME }}
# inspect and add a minute sleep to avoid HTTP 429 error (too many requests...)
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
sleep 1m

0 comments on commit cf66abd

Please sign in to comment.