From cb629038dfdf3e233c29ca0bd29ec738496aa91e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Kr=C4=8Dek?= Date: Sat, 26 Aug 2023 18:26:35 +0000 Subject: [PATCH] fix(workflows): cache image build to scaleway repo --- .github/workflows/deploy.yml | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d49c2cf8..ad6bd7d7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,7 @@ on: branches: - main - develop + - issue-163 jobs: @@ -14,24 +15,26 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: nologin + password: ${{ secrets.SCW_SECRET_KEY }} + registry: ${{ secrets.SCW_REGISTRY_ENDPOINT }} + - name: Build uses: docker/build-push-action@v4 with: context: . load: true file: webpack/Dockerfile - # TODO: ends with 400 - # cache-from: type=registry,ref=${{ secrets.SCW_REGISTRY_ENDPOINT }}/web:buildcache - # cache-to: type=registry,ref=${{ secrets.SCW_REGISTRY_ENDPOINT }}/web:buildcache,mode=max - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ secrets.SCW_REGISTRY_ENDPOINT }}/web:buildcache + cache-to: type=registry,ref=${{ secrets.SCW_REGISTRY_ENDPOINT }}/web:buildcache,mode=max tags: webpack:latest + provenance: false - name: Extract compiled results run: | @@ -110,11 +113,8 @@ jobs: context: . file: fiesta/Dockerfile load: true -# TODO: ends with 400 -# cache-from: type=registry,ref=${{ secrets.SCW_REGISTRY_ENDPOINT }}/web:buildcache -# cache-to: type=registry,ref=${{ secrets.SCW_REGISTRY_ENDPOINT }}/web:buildcache,mode=max - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ secrets.SCW_REGISTRY_ENDPOINT }}/web:buildcache + cache-to: type=registry,ref=${{ secrets.SCW_REGISTRY_ENDPOINT }}/web:buildcache,mode=max tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -201,11 +201,8 @@ jobs: context: . file: nginx/proxy.Dockerfile push: true -# TODO: ends with 400 -# cache-from: type=registry,ref=${{ secrets.SCW_REGISTRY_ENDPOINT }}/web:buildcache -# cache-to: type=registry,ref=${{ secrets.SCW_REGISTRY_ENDPOINT }}/web:buildcache,mode=max - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ secrets.SCW_REGISTRY_ENDPOINT }}/web:buildcache + cache-to: type=registry,ref=${{ secrets.SCW_REGISTRY_ENDPOINT }}/web:buildcache,mode=max tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}