diff --git a/.gitea/workflows/build-push.yaml b/.gitea/workflows/build-push.yaml index 45a7426..24ea7f7 100644 --- a/.gitea/workflows/build-push.yaml +++ b/.gitea/workflows/build-push.yaml @@ -30,7 +30,17 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + # Login to Docker Hub to avoid pull rate limits + - name: Login to Docker Hub + if: vars.DOCKERHUB_USERNAME != '' + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # Only login to Gitea when pushing (not PRs) and secrets are available - name: Login to Gitea Registry + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: git.daviestechlabs.io @@ -70,7 +80,15 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + if: vars.DOCKERHUB_USERNAME != '' + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to Gitea Registry + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: git.daviestechlabs.io @@ -110,7 +128,15 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + if: vars.DOCKERHUB_USERNAME != '' + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to Gitea Registry + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: git.daviestechlabs.io @@ -150,7 +176,15 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + if: vars.DOCKERHUB_USERNAME != '' + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to Gitea Registry + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: git.daviestechlabs.io