Skip to content

Commit

Permalink
Switch from Dockerhub to ghcr.io. Enable layers cache (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
micorix authored Dec 5, 2021
1 parent 4da5c1f commit daccbc5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build-push-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -48,15 +48,18 @@ 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
with:
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
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,12 +29,14 @@ 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
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
cache-from: type=registry,ref=ghcr.io/po8klasie/po8klasie-api:cache-master
3 changes: 2 additions & 1 deletion .github/workflows/test-building.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit daccbc5

Please sign in to comment.