use docker layer cache

This commit is contained in:
2023-10-26 15:40:08 +02:00
parent 3b1dcdc718
commit 702e302f3d
+8 -10
View File
@@ -44,22 +44,20 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: docker build - uses: docker/setup-buildx-action@v3
run: |
cd ./frontend
docker build . -t kemkas:${GITHUB_SHA::8}
- name: Install doctl - name: Install doctl
uses: digitalocean/action-doctl@v2 uses: digitalocean/action-doctl@v2
with: with:
token: ${{ secrets.DO_ACCESS_TOKEN }} token: ${{ secrets.DO_ACCESS_TOKEN }}
- name: Log in to DigitalOcean Container Registry with short-lived credentials - name: Log in to DigitalOcean Container Registry with short-lived credentials
run: doctl registry login --expiry-seconds 1200 run: doctl registry login --expiry-seconds 1200
- name: Tag container image - uses: docker/build-push-action@v5
run: | with:
docker tag kemkas:${GITHUB_SHA::8} registry.digitalocean.com/kemkas/kemkas:${GITHUB_SHA::8} context: frontend/
- name: Push image to Container Registry cache-from: type=gha
run: | cache-to: type=gha,mode=max
docker push registry.digitalocean.com/kemkas/kemkas:${GITHUB_SHA::8} push: true
tags: registry.digitalocean.com/kemkas/kemkas:${GITHUB_SHA::8}
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest