44 workflow_dispatch :
55 schedule :
66 - cron : ' 0 0 * * 0' # weekly on Sunday
7+ pull_request :
78# pull_request: # deleted this line
89
910jobs :
2526 env :
2627 R_VERSION : ${{ needs.rversion.outputs.R_VERSION }}
2728 DEFAULT_R_VERSION : 4.4
29+ PUSH : ${{ github.event_name != 'pull_request' }}
2830 steps :
2931 - uses : actions/checkout@v4
3032
@@ -36,13 +38,14 @@ jobs:
3638 uses : docker/setup-buildx-action@v3
3739
3840 - name : Login to DockerHub
39- if : ${{ secrets.DOCKERHUB_USERNAME != '' }}
41+ if : env.PUSH == 'true' && ${{ secrets.DOCKERHUB_USERNAME != '' }}
4042 uses : docker/login-action@v3
4143 with :
4244 username : ${{ secrets.DOCKERHUB_USERNAME }}
4345 password : ${{ secrets.DOCKERHUB_PASSWORD }}
4446
4547 - name : Login to GitHub Container Registry
48+ if : env.PUSH == 'true'
4649 uses : docker/login-action@v3
4750 with :
4851 registry : ghcr.io
7578 with :
7679 context : docker/depends
7780 file : docker/depends/Dockerfile
78- push : true
81+ push : ${{ env.PUSH }}
7982 platforms : linux/amd64
8083 cache-from : type=gha
8184 cache-to : type=gha,mode=max
@@ -110,7 +113,7 @@ jobs:
110113 with :
111114 context : .
112115 file : docker/base/Dockerfile
113- push : true
116+ push : ${{ env.PUSH }}
114117 platforms : linux/amd64
115118 cache-from : type=gha
116119 cache-to : type=gha,mode=max
@@ -146,7 +149,7 @@ jobs:
146149 with :
147150 context : docker/models
148151 file : docker/models/Dockerfile
149- push : true
152+ push : ${{ env.PUSH }}
150153 platforms : linux/amd64
151154 cache-from : type=gha
152155 cache-to : type=gha,mode=max
@@ -191,7 +194,7 @@ jobs:
191194 with :
192195 context : .
193196 file : docker/docs/Dockerfile
194- push : true
197+ push : ${{ env.PUSH }}
195198 platforms : linux/amd64
196199 cache-from : type=gha
197200 cache-to : type=gha,mode=max
@@ -204,7 +207,7 @@ jobs:
204207 with :
205208 context : docker/executor
206209 file : docker/executor/Dockerfile
207- push : true
210+ push : ${{ env.PUSH }}
208211 platforms : linux/amd64
209212 cache-from : type=gha
210213 cache-to : type=gha,mode=max
@@ -217,7 +220,7 @@ jobs:
217220 with :
218221 context : apps/api
219222 file : apps/api/Dockerfile
220- push : true
223+ push : ${{ env.PUSH }}
221224 platforms : linux/amd64
222225 cache-from : type=gha
223226 cache-to : type=gha,mode=max
@@ -231,7 +234,7 @@ jobs:
231234 with :
232235 context : .
233236 file : docker/web/Dockerfile
234- push : true
237+ push : ${{ env.PUSH }}
235238 platforms : linux/amd64,linux/arm64
236239 cache-from : type=gha
237240 cache-to : type=gha,mode=max
@@ -242,7 +245,7 @@ jobs:
242245 with :
243246 context : .
244247 file : shiny/dbsync/Dockerfile
245- push : true
248+ push : ${{ env.PUSH }}
246249 platforms : linux/amd64
247250 cache-from : type=gha
248251 cache-to : type=gha,mode=max
@@ -255,7 +258,7 @@ jobs:
255258 with :
256259 context : docker/data
257260 file : docker/data/Dockerfile
258- push : true
261+ push : ${{ env.PUSH }}
259262 platforms : linux/amd64,linux/arm64
260263 cache-from : type=gha
261264 cache-to : type=gha,mode=max
@@ -266,7 +269,7 @@ jobs:
266269 with :
267270 context : docker/monitor
268271 file : docker/monitor/Dockerfile
269- push : true
272+ push : ${{ env.PUSH }}
270273 platforms : linux/amd64,linux/arm64
271274 cache-from : type=gha
272275 cache-to : type=gha,mode=max
@@ -277,7 +280,7 @@ jobs:
277280 with :
278281 context : docker/rstudio-nginx
279282 file : docker/rstudio-nginx/Dockerfile
280- push : true
283+ push : ${{ env.PUSH }}
281284 platforms : linux/amd64,linux/arm64
282285 cache-from : type=gha
283286 cache-to : type=gha,mode=max
0 commit comments