Skip to content

Commit cd3d865

Browse files
committed
Avoid API limit by querying Docker Hub unauthenticated in Github Actions
1 parent f7b4a5a commit cd3d865

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,30 @@ jobs:
8181
matrix:
8282
ps-version: ${{ fromJson(needs.list_prestashop_images.outputs.versions) }}
8383
steps:
84-
- name: Login to Docker Hub
85-
uses: docker/login-action@v2
86-
with:
87-
username: ${{ secrets.DOCKERHUB_USERNAME }}
88-
password: ${{ secrets.DOCKERHUB_TOKEN }}
89-
9084
- name: Enable multi-platform builds
9185
run: docker buildx create --name container --driver=docker-container
9286

9387
- uses: actions/checkout@v2
94-
- name: Set up Python 3.8
88+
89+
- name: Set up Python
9590
uses: actions/setup-python@v2
9691
with:
9792
python-version: 3.9
93+
9894
- name: Install dependencies
9995
run: pip install -r requirements.txt
10096

101-
- name: Build & Push Docker images
97+
- name: Build Docker images
98+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
99+
run: DOCKER_REPOSITORY=${{ vars.DOCKER_REPOSITORY}} ./prestashop_docker.py --quiet tag build ${{ matrix.ps-version }} --force
100+
101+
- name: Login to Docker Hub
102+
uses: docker/login-action@v2
103+
with:
104+
username: ${{ secrets.DOCKERHUB_USERNAME }}
105+
password: ${{ secrets.DOCKERHUB_TOKEN }}
106+
107+
- name: Build by using cache and push Docker images
102108
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
103109
run: DOCKER_REPOSITORY=${{ vars.DOCKER_REPOSITORY}} ./prestashop_docker.py --quiet tag push ${{ matrix.ps-version }} --force
104110

0 commit comments

Comments
 (0)