File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,15 +23,31 @@ jobs:
2323 with :
2424 username : ${{ secrets.DOCKER_USERNAME }}
2525 password : ${{ secrets.DOCKER_PASSWORD }}
26- - name : build the image
27- run : |
28- docker buildx build --push \
29- --tag ticklethepanda/rpi-timelapse:latest \
30- --platform linux/arm/v7 ./rpi-timelapse
26+ - name : Cache Docker layers
27+ uses : actions/cache@v2
28+ with :
29+ path : /tmp/.buildx-cache
30+ key : ${{ runner.os }}-buildx-timelapse-${{ github.sha }}
31+ restore-keys : |
32+ ${{ runner.os }}-buildx-timelapse-
33+ - name : Build and push
34+ uses :
35+ with :
36+ context : ./rpi-timelapse
37+ platforms : linux/arm/v7
38+ push : true
39+ tags : ticklethepanda/rpi-timelapse:latest
40+ cache-from : type=local,src=/tmp/.buildx-cache
41+ cache-to : type=local,dest=/tmp/.buildx-cache-new
3142 - name : Setup k8s context
3243 uses : azure/k8s-set-context@v1
3344 with :
3445 method : kubeconfig
3546 kubeconfig : ${{ secrets.KUBE_CONFIG }}
3647 - name : Rollout latest image
3748 run : kubectl rollout restart deployment/timelapse-deployment --namespace=home
49+ # prevent huge cache
50+ - name : Move cache
51+ run :
52+ rm -rf /tmp/.buildx-cache
53+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
You can’t perform that action at this time.
0 commit comments