From daccbc59f9547bbefae515c194be997b2d82cfb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Or=C4=99ziak?= Date: Mon, 6 Dec 2021 00:12:40 +0100 Subject: [PATCH] Switch from Dockerhub to ghcr.io. Enable layers cache (#72) --- .github/workflows/build-push-deploy.yml | 9 ++++++--- .github/workflows/build-push.yml | 8 +++++--- .github/workflows/test-building.yml | 3 ++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-push-deploy.yml b/.github/workflows/build-push-deploy.yml index 04d0848..0349541 100644 --- a/.github/workflows/build-push-deploy.yml +++ b/.github/workflows/build-push-deploy.yml @@ -35,7 +35,7 @@ jobs: uses: crazy-max/ghaction-docker-meta@v2 with: images: | - warsawlo/warsawlo-django + ghcr.io/po8klasie/po8klasie-api tags: | type=ref,event=branch type=sha @@ -48,8 +48,9 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v1 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + registry: ghcr.io + username: ${{ secrets.GHCR_USERNAME }} + password: ${{ secrets.GHCR_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 @@ -57,6 +58,8 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} push: true + cache-from: type=registry,ref=ghcr.io/po8klasie/po8klasie-api:cache-master + cache-to: type=registry,ref=ghcr.io/po8klasie/po8klasie-api:cache-master - name: Set up Cloud SDK uses: google-github-actions/setup-gcloud@master diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index e5ed5e1..fa590ad 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -16,7 +16,7 @@ jobs: uses: crazy-max/ghaction-docker-meta@v2 with: images: | - warsawlo/warsawlo-django + ghcr.io/po8klasie/po8klasie-api tags: | type=ref,event=tag type=sha @@ -29,8 +29,9 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v1 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + registry: ghcr.io + username: ${{ secrets.GHCR_USERNAME }} + password: ${{ secrets.GHCR_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 @@ -38,3 +39,4 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} push: true + cache-from: type=registry,ref=ghcr.io/po8klasie/po8klasie-api:cache-master diff --git a/.github/workflows/test-building.yml b/.github/workflows/test-building.yml index f15cb2f..04c61d4 100644 --- a/.github/workflows/test-building.yml +++ b/.github/workflows/test-building.yml @@ -14,7 +14,7 @@ jobs: uses: crazy-max/ghaction-docker-meta@v2 with: images: | - warsawlo/warsawlo-django + ghcr.io/po8klasie/po8klasie-api tags: | type=sha type=ref,event=pr @@ -29,6 +29,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} push: false load: true + cache-from: type=registry,ref=ghcr.io/po8klasie/po8klasie-api:cache-master - name: Get SHA tag id: get-sha-tag