File tree 1 file changed +21
-5
lines changed
1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,31 @@ jobs:
23
23
with :
24
24
username : ${{ secrets.DOCKER_USERNAME }}
25
25
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
31
42
- name : Setup k8s context
32
43
uses : azure/k8s-set-context@v1
33
44
with :
34
45
method : kubeconfig
35
46
kubeconfig : ${{ secrets.KUBE_CONFIG }}
36
47
- name : Rollout latest image
37
48
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