File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -34,17 +34,33 @@ jobs:
34
34
- name : Set up Docker Buildx
35
35
uses : docker/setup-buildx-action@v3
36
36
37
+ - name : Cache Docker layers
38
+ uses : actions/cache@v4
39
+ with :
40
+ path : /tmp/.buildx-cache
41
+ key : ${{ runner.os }}-buildx-${{ github.sha }}
42
+ restore-keys : |
43
+ ${{ runner.os }}-buildx-
44
+
45
+ - name : Echo NEXT_PUBLIC_DRIVE_LINK to .env.local
46
+ run : echo "NEXT_PUBLIC_DRIVE_LINK=${{ secrets.NEXT_PUBLIC_DRIVE_LINK }}" > .env.local
47
+
37
48
- name : Build Docker container
38
49
env :
39
- NEXT_PUBLIC_DRIVE_LINK : ${{ secrets.NEXT_PUBLIC_DRIVE_LINK }}
40
50
PRODUCTION_BUILD : ' true'
41
51
run : |
42
52
docker buildx build \
43
- --build-arg NEXT_PUBLIC_DRIVE_LINK=${{ secrets.NEXT_PUBLIC_DRIVE_LINK }} \
44
- --output type=docker,dest=csclub-website.tar \
45
- --platform=linux/arm64 --file=Dockerfile -t csclub-website .
53
+ --cache-from=type=local,src=/tmp/.buildx-cache \
54
+ --cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max \
55
+ --output type=docker,dest=csclub-website.tar \
56
+ --platform=linux/arm64 --file=Dockerfile -t csclub-website .
46
57
gzip csclub-website.tar
47
58
59
+ - name : Save Docker cache
60
+ if : success()
61
+ run : |
62
+ rsync -a --delete /tmp/.buildx-cache-new/ /tmp/.buildx-cache/
63
+
48
64
- name : Copy image and compose file to S3
49
65
run : |
50
66
aws s3 cp ./csclub-website.tar.gz s3://${{ secrets.AWS_S3_BUCKET }}/website/
You can’t perform that action at this time.
0 commit comments