Skip to content

Commit b497db3

Browse files
committed
πŸš€ Add-on CI improvements
1 parent 1bea334 commit b497db3

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

β€Ž.github/workflows/ci.yamlβ€Ž

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,9 @@ jobs:
132132
uses: actions/[email protected]
133133
with:
134134
path: /tmp/.docker-cache
135-
key:
136-
docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha
137-
}}
135+
key: docker-${{ matrix.architecture }}-${{ github.sha }}
138136
restore-keys: |
139-
docker-${{ github.ref }}-${{ matrix.architecture }}
137+
docker-${{ matrix.architecture }}
140138
- name: πŸ— Set up QEMU
141139
uses: docker/[email protected]
142140
- name: πŸ— Set up Docker Buildx
@@ -186,7 +184,7 @@ jobs:
186184
cache-from: |
187185
type=local,src=/tmp/.docker-cache
188186
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge
189-
cache-to: type=local,mode=max,dest=/tmp/.docker-cache
187+
cache-to: type=local,mode=max,dest=/tmp/.docker-cache-new
190188
platforms: ${{ steps.flags.outputs.platform }}
191189
build-args: |
192190
BUILD_ARCH=${{ matrix.architecture }}
@@ -197,3 +195,11 @@ jobs:
197195
BUILD_REF=${{ github.sha }}
198196
BUILD_REPOSITORY=${{ github.repository }}
199197
BUILD_VERSION=edge
198+
# This ugly bit is necessary, or our cache will grow forever...
199+
# Well until we hit GitHub's limit of 5GB :)
200+
# https://github.com/docker/build-push-action/issues/252
201+
# https://github.com/moby/buildkit/issues/1896
202+
- name: 🚚 Swap build cache
203+
run: |
204+
rm -rf /tmp/.docker-cache
205+
mv /tmp/.docker-cache-new /tmp/.docker-cache

β€Ž.github/workflows/deploy.yamlβ€Ž

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,9 @@ jobs:
7575
uses: actions/[email protected]
7676
with:
7777
path: /tmp/.docker-cache
78-
key:
79-
docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha
80-
}}
78+
key: docker-${{ matrix.architecture }}-${{ github.sha }}
8179
restore-keys: |
82-
docker-${{ github.ref }}-${{ matrix.architecture }}
80+
docker-${{ matrix.architecture }}
8381
- name: πŸ— Set up QEMU
8482
uses: docker/[email protected]
8583
- name: πŸ— Set up Docker Buildx
@@ -140,7 +138,7 @@ jobs:
140138
cache-from: |
141139
type=local,src=/tmp/.docker-cache
142140
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge
143-
cache-to: type=local,mode=max,dest=/tmp/.docker-cache
141+
cache-to: type=local,mode=max,dest=/tmp/.docker-cache-new
144142
platforms: ${{ steps.flags.outputs.platform }}
145143
build-args: |
146144
BUILD_ARCH=${{ matrix.architecture }}
@@ -151,6 +149,14 @@ jobs:
151149
BUILD_REF=${{ github.sha }}
152150
BUILD_REPOSITORY=${{ github.repository }}
153151
BUILD_VERSION=${{ needs.information.outputs.version }}
152+
# This ugly bit is necessary, or our cache will grow forever...
153+
# Well until we hit GitHub's limit of 5GB :)
154+
# https://github.com/docker/build-push-action/issues/252
155+
# https://github.com/moby/buildkit/issues/1896
156+
- name: 🚚 Swap build cache
157+
run: |
158+
rm -rf /tmp/.docker-cache
159+
mv /tmp/.docker-cache-new /tmp/.docker-cache
154160
- name: πŸ” Notarize
155161
# yamllint disable rule:line-length
156162
run: |

β€Ž.github/workflows/pr-labels.yamlβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: PR Labels
33

44
# yamllint disable-line rule:truthy
55
on:
6-
pull_request:
6+
pull_request_target:
77
types: [opened, labeled, unlabeled, synchronize]
88

99
jobs:
@@ -14,6 +14,7 @@ jobs:
1414
- name: 🏷 Verify PR has a valid label
1515
uses: jesusvasquez333/[email protected]
1616
with:
17+
pull-request-number: "${{ github.event.pull_request.number }}"
1718
github-token: "${{ secrets.GITHUB_TOKEN }}"
1819
valid-labels: >-
1920
breaking-change, bugfix, documentation, enhancement, refactor,

0 commit comments

Comments
Β (0)