@@ -3,11 +3,14 @@ name: ci
33on :
44 push :
55 branches :
6+ - main
67 - master
78 paths-ignore :
89 - ' **/README.md'
910 tags :
1011 - ' *'
12+ schedule :
13+ - cron : ' 0 3 * * 1'
1114 workflow_dispatch :
1215 inputs :
1316 push :
@@ -69,65 +72,89 @@ jobs:
6972 curl -fL "https://raw.githubusercontent.com/b4b4r07/httpstat/master/httpstat.sh" -o _dl/httpstat.sh
7073
7174 - name : Login to Docker Hub
72- if : inputs.push == true || github.event_name == 'push'
75+ if : inputs.push == true || github.event_name == 'push' || github.event_name == 'schedule'
7376 uses : docker/login-action@v2
7477 with :
7578 username : ${{ secrets.DOCKERHUB_USERNAME }}
7679 password : ${{ secrets.DOCKERHUB_TOKEN }}
7780
7881 - name : Set up QEMU
79- if : inputs.push == true || github.event_name == 'push '
82+ if : github.event_name == 'schedule '
8083 uses : docker/setup-qemu-action@v3
8184 with :
82- platforms : linux/amd64
85+ platforms : linux/arm64
8386
8487 - name : Set up Docker Buildx
85- if : inputs.push == true || github.event_name == 'push'
88+ if : inputs.push == true || github.event_name == 'push' || github.event_name == 'schedule'
8689 uses : docker/setup-buildx-action@v2
8790
8891 - name : Build (no push) via docker build (act)
8992 if : inputs.push != true && github.event_name != 'push' && env.ACT == 'true'
9093 run : |
9194 DOCKER_BUILDKIT=1 docker build --platform linux/amd64 --load \
92- -t curl-http3 :${IMAGE_TAG} -t curl-http3 :latest .
95+ -t curl-edge :${IMAGE_TAG} -t curl-edge :latest .
9396
9497 - name : Build (no push)
95- if : inputs.push != true && github.event_name != 'push' && env.ACT != 'true'
98+ if : inputs.push != true && github.event_name != 'push' && github.event_name != 'schedule' && env.ACT != 'true'
9699 uses : docker/build-push-action@v4
97100 with :
98101 context : .
99102 push : false
100103 platforms : linux/amd64
101104 load : true
102105 tags : |
103- curl-http3 :${{ env.IMAGE_TAG }}
104- curl-http3 :latest
106+ curl-edge :${{ env.IMAGE_TAG }}
107+ curl-edge :latest
105108
106109 - name : Test curl -V
107110 if : inputs.push != true && github.event_name != 'push'
108- run : docker run --rm curl-http3 :${IMAGE_TAG} curl -V
111+ run : docker run --rm curl-edge :${IMAGE_TAG} -V
109112
110113 - name : Test HTTP/3 to Cloudflare
111114 if : inputs.push != true && github.event_name != 'push'
112115 run : |
113- docker run --rm --network host curl-http3 :${IMAGE_TAG} \
114- curl -I --http3 https://cloudflare-quic.com/ || \
115- docker run --rm --network host curl-http3 :${IMAGE_TAG} \
116- curl -I --http3 https://www.cloudflare.com/ --connect-timeout 10 || true
116+ docker run --rm --network host curl-edge :${IMAGE_TAG} \
117+ -I --http3 https://cloudflare-quic.com/ || \
118+ docker run --rm --network host curl-edge :${IMAGE_TAG} \
119+ -I --http3 https://www.cloudflare.com/ --connect-timeout 10 || true
117120
118121 - name : Test httpstat script
119122 if : inputs.push != true && github.event_name != 'push'
120123 run : |
121- docker run --rm --network host curl-http3 :${IMAGE_TAG} \
124+ docker run --rm --network host curl-edge :${IMAGE_TAG} \
122125 /opt/httpstat.sh -I --http3 https://cloudflare-quic.com/ || true
123126
124- - name : Build and push
127+ - name : Build and push (push/dispatch, amd64 only)
125128 if : inputs.push == true || github.event_name == 'push'
126129 uses : docker/build-push-action@v4
127130 with :
128131 context : .
129132 push : true
130133 platforms : linux/amd64
134+ cache-from : type=gha
135+ cache-to : type=gha,mode=max
136+ tags : |
137+ getpagespeed/curl-edge:amd64-${{ env.IMAGE_TAG }}
138+ getpagespeed/curl-edge:latest-amd64
139+
140+ - name : Build and push (nightly, arm64 only)
141+ if : github.event_name == 'schedule'
142+ uses : docker/build-push-action@v4
143+ with :
144+ context : .
145+ push : true
146+ platforms : linux/arm64
147+ cache-from : type=gha
148+ cache-to : type=gha,mode=max
131149 tags : |
132- ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.GITHUB_REPOSITORY_NAME_PART }}:${{ env.IMAGE_TAG }}
133- ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.GITHUB_REPOSITORY_NAME_PART }}:latest
150+ getpagespeed/curl-edge:arm64-${{ env.IMAGE_TAG }}
151+ getpagespeed/curl-edge:latest-arm64
152+
153+ - name : Create multi-arch manifest (nightly)
154+ if : github.event_name == 'schedule'
155+ run : |
156+ docker buildx imagetools create \
157+ -t getpagespeed/curl-edge:${IMAGE_TAG} \
158+ -t getpagespeed/curl-edge:latest \
159+ getpagespeed/curl-edge:amd64-${IMAGE_TAG} \
160+ getpagespeed/curl-edge:arm64-${IMAGE_TAG}
0 commit comments