Skip to content

Commit 7852eb7

Browse files
authored
Pre-pull mongodb image in CI to use authenticated docker credentials. (#336)
1 parent bb1bd27 commit 7852eb7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ jobs:
5353
username: ${{ secrets.DOCKERHUB_USERNAME }}
5454
password: ${{ secrets.DOCKERHUB_TOKEN }}
5555

56+
# The mongodb-github-action below doesn't use the Docker credentials for the pull.
57+
# We pre-pull, so that the image is cached.
58+
- name: Pre-pull Mongo image
59+
run: docker pull mongo:8.0
60+
5661
- name: Start MongoDB
5762
uses: supercharge/[email protected]
5863
with:
@@ -134,6 +139,11 @@ jobs:
134139
-p 5431:5432 \
135140
-d postgres:${{ matrix.postgres-version }}
136141
142+
# The mongodb-github-action below doesn't use the Docker credentials for the pull.
143+
# We pre-pull, so that the image is cached.
144+
- name: Pre-pull Mongo image
145+
run: docker pull mongo:8.0
146+
137147
- name: Start MongoDB
138148
uses: supercharge/[email protected]
139149
with:
@@ -206,6 +216,11 @@ jobs:
206216
--enforce_gtid_consistency=ON \
207217
--server-id=1
208218
219+
# The mongodb-github-action below doesn't use the Docker credentials for the pull.
220+
# We pre-pull, so that the image is cached.
221+
- name: Pre-pull Mongo image
222+
run: docker pull mongo:8.0
223+
209224
- name: Start MongoDB
210225
uses: supercharge/[email protected]
211226
with:
@@ -274,6 +289,11 @@ jobs:
274289
username: ${{ secrets.DOCKERHUB_USERNAME }}
275290
password: ${{ secrets.DOCKERHUB_TOKEN }}
276291

292+
# The mongodb-github-action below doesn't use the Docker credentials for the pull.
293+
# We pre-pull, so that the image is cached.
294+
- name: Pre-pull Mongo image
295+
run: docker pull mongo:${{ matrix.mongodb-version }}
296+
277297
- name: Start MongoDB
278298
uses: supercharge/[email protected]
279299
with:

0 commit comments

Comments
 (0)