From f69606b26f800e42842c48c6087460e5909a0d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Cl=C3=A9ment?= Date: Thu, 6 May 2021 12:07:38 +0200 Subject: [PATCH 1/7] :pencil2: [CI/CD] Fix push on tag --- .github/workflows/build_addon.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_addon.yml b/.github/workflows/build_addon.yml index f8e8833..25863d0 100644 --- a/.github/workflows/build_addon.yml +++ b/.github/workflows/build_addon.yml @@ -82,7 +82,7 @@ jobs: - name: Build and push ${{matrix.arch}} uses: docker/build-push-action@v2 with: - push: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/tags/*' }} + push: ${{ github.ref == 'refs/heads/master' || startsWith('refs/tags/', github.ref) }} context: ./${{env.TARGET}} tags: ${{env.TAGS}} labels: io.hass.name=${{env.NAME}}, io.hass.description=${{env.DESCRIPTION}}, io.hass.url=${{env.URL}}, io.hass.arch=${{matrix.arch}}, io.hass.version=${{env.VERSION}}, io.hass.type=addon From cebb8ade1bffd989ca13f3089be4b8fafb9a15ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Cl=C3=A9ment?= Date: Thu, 6 May 2021 12:14:55 +0200 Subject: [PATCH 2/7] :pencil2: [CI/CD] Don't push if PR --- .github/workflows/build_addon.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build_addon.yml b/.github/workflows/build_addon.yml index 25863d0..9f7b566 100644 --- a/.github/workflows/build_addon.yml +++ b/.github/workflows/build_addon.yml @@ -82,8 +82,7 @@ jobs: - name: Build and push ${{matrix.arch}} uses: docker/build-push-action@v2 with: - push: ${{ github.ref == 'refs/heads/master' || startsWith('refs/tags/', github.ref) }} - context: ./${{env.TARGET}} + push: ${{ github.event_name != 'pull_request' }} tags: ${{env.TAGS}} labels: io.hass.name=${{env.NAME}}, io.hass.description=${{env.DESCRIPTION}}, io.hass.url=${{env.URL}}, io.hass.arch=${{matrix.arch}}, io.hass.version=${{env.VERSION}}, io.hass.type=addon build-args: | From fc1698af37cd0397eaab7c0a62eb5423d7d12258 Mon Sep 17 00:00:00 2001 From: Sebastien Clement Date: Thu, 6 May 2021 12:32:23 +0200 Subject: [PATCH 3/7] :pencil2: Try to fix CI/CD --- .github/workflows/build_addon.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_addon.yml b/.github/workflows/build_addon.yml index 9f7b566..6b1943c 100644 --- a/.github/workflows/build_addon.yml +++ b/.github/workflows/build_addon.yml @@ -92,3 +92,4 @@ jobs: file: ./${{env.TARGET}}/Dockerfile cache-from: type=registry,ref=${{env.REPOSITORY}}/${{env.IMAGE}}/${{matrix.arch}}:latest cache-to: type=inline + context: . From 4f9e973a46eca28355f5951ab57549d30554ccd3 Mon Sep 17 00:00:00 2001 From: Sebastien Clement Date: Thu, 6 May 2021 13:45:08 +0200 Subject: [PATCH 4/7] :pencil2: Disable cache for build --- .github/workflows/build_addon.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_addon.yml b/.github/workflows/build_addon.yml index 6b1943c..696c475 100644 --- a/.github/workflows/build_addon.yml +++ b/.github/workflows/build_addon.yml @@ -90,6 +90,5 @@ jobs: BUILD_VERSION=${{env.VERSION}} IMAGE_SOURCE=${{env.IMAGE_SOURCE}} file: ./${{env.TARGET}}/Dockerfile - cache-from: type=registry,ref=${{env.REPOSITORY}}/${{env.IMAGE}}/${{matrix.arch}}:latest - cache-to: type=inline - context: . +# cache-from: type=registry,ref=${{env.REPOSITORY}}/${{env.IMAGE}}/${{matrix.arch}}:latest +# cache-to: type=inline From 90680ff12fc2b67d5d9b00e0ae0854c347658203 Mon Sep 17 00:00:00 2001 From: Sebastien Clement Date: Thu, 6 May 2021 13:55:11 +0200 Subject: [PATCH 5/7] :pencil2: Try to fix CI/CD --- .github/workflows/build_addon.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_addon.yml b/.github/workflows/build_addon.yml index 696c475..3f7533a 100644 --- a/.github/workflows/build_addon.yml +++ b/.github/workflows/build_addon.yml @@ -92,3 +92,4 @@ jobs: file: ./${{env.TARGET}}/Dockerfile # cache-from: type=registry,ref=${{env.REPOSITORY}}/${{env.IMAGE}}/${{matrix.arch}}:latest # cache-to: type=inline + context: . From 164bbc161c4be25bffb865217534076bf920aeb1 Mon Sep 17 00:00:00 2001 From: Sebastien Clement Date: Thu, 6 May 2021 13:59:51 +0200 Subject: [PATCH 6/7] :pencil2: Try to fix CI/CD --- .github/workflows/build_addon.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_addon.yml b/.github/workflows/build_addon.yml index 3f7533a..317dc77 100644 --- a/.github/workflows/build_addon.yml +++ b/.github/workflows/build_addon.yml @@ -92,4 +92,4 @@ jobs: file: ./${{env.TARGET}}/Dockerfile # cache-from: type=registry,ref=${{env.REPOSITORY}}/${{env.IMAGE}}/${{matrix.arch}}:latest # cache-to: type=inline - context: . + context: ./${{env.TARGET}}/ From 3bc496ccbc3a75ea461eb69daf19e2c4dc57421b Mon Sep 17 00:00:00 2001 From: Sebastien Clement Date: Thu, 6 May 2021 14:04:14 +0200 Subject: [PATCH 7/7] :pencil2: Try re-enable cache --- .github/workflows/build_addon.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_addon.yml b/.github/workflows/build_addon.yml index 317dc77..20f1041 100644 --- a/.github/workflows/build_addon.yml +++ b/.github/workflows/build_addon.yml @@ -90,6 +90,6 @@ jobs: BUILD_VERSION=${{env.VERSION}} IMAGE_SOURCE=${{env.IMAGE_SOURCE}} file: ./${{env.TARGET}}/Dockerfile -# cache-from: type=registry,ref=${{env.REPOSITORY}}/${{env.IMAGE}}/${{matrix.arch}}:latest -# cache-to: type=inline + cache-from: type=registry,ref=${{env.REPOSITORY}}/${{env.IMAGE}}/${{matrix.arch}}:latest + cache-to: type=inline context: ./${{env.TARGET}}/