|
14 | 14 |
|
15 | 15 | build_and_test_docker: |
16 | 16 | uses: ./.github/workflows/build-test-docker.yml |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + include: |
| 20 | + - platform: linux/amd64 |
| 21 | + cache-from: type=registry,ref=ghcr.io/elementsinteractive/twyn:buildcache-amd64 |
| 22 | + cache-to: type=registry,ref=ghcr.io/elementsinteractive/twyn:buildcache-amd64 |
| 23 | + image-name: build-amd64 |
| 24 | + setup-qemu: false |
| 25 | + - platform: linux/arm64 |
| 26 | + cache-from: type=registry,ref=ghcr.io/elementsinteractive/twyn:buildcache-arm64 |
| 27 | + cache-to: type=registry,ref=ghcr.io/elementsinteractive/twyn:buildcache-arm64 |
| 28 | + image-name: build-arm64 |
| 29 | + setup-qemu: true |
| 30 | + |
17 | 31 | with: |
18 | | - image-tag: latest |
| 32 | + image-tag: "pr-${{ github.event.pull_request.number }}" |
| 33 | + platform: ${{ matrix.platform }} |
| 34 | + cache-from: ${{ matrix.cache-from }} |
| 35 | + cache-to: ${{ matrix.cache-to }} |
| 36 | + image-name: ${{ matrix.image-name }} |
| 37 | + setup-qemu: ${{ matrix.setup-qemu }} |
| 38 | + |
| 39 | + secrets: inherit |
19 | 40 |
|
20 | 41 | publish_to_pypi: |
21 | 42 | name: Publish to PyPI |
|
77 | 98 | type=registry,ref=ghcr.io/elementsinteractive/twyn:buildcache-amd64 |
78 | 99 | type=registry,ref=ghcr.io/elementsinteractive/twyn:buildcache-arm64 |
79 | 100 |
|
80 | | - - name: Delete old cache entries |
81 | | - env: |
82 | | - GH_TOKEN: ${{ github.token }} |
83 | | - run: | |
84 | | - # Get all versions of the container package |
85 | | - versions=$(gh api "orgs/elementsinteractive/packages/container/twyn/versions" --paginate) |
86 | | -
|
87 | | - # Extract version IDs that do NOT have any buildcache-* tags (buildcache-amd64, buildcache-arm64, etc.) |
88 | | - ids_to_delete=$(echo "$versions" | jq -r '.[] | select(.metadata.container.tags | map(test("^buildcache-")) | any | not) | .id') |
89 | | -
|
90 | | - # Delete them |
91 | | - for id in $ids_to_delete; do |
92 | | - echo "Deleting old cache version ID: $id" |
93 | | - gh api -X DELETE "orgs/elementsinteractive/packages/container/twyn/versions/$id" |
94 | | - done |
95 | | -
|
96 | 101 | release_notes: |
97 | 102 | runs-on: ubuntu-latest |
98 | 103 | needs: [publish_to_pypi, publish_to_dockerhub] |
|
0 commit comments