Replace buildx/login GitHub Actions with plain docker commands

setup-buildx-action downloads from GitHub Releases which is slow
and unreliable from the Forgejo runner. Plain docker build/push
works fine since Docker is already on the runner host.
This commit is contained in:
Graham McIntire 2026-04-10 17:22:57 -05:00
parent b42b777150
commit 669fe07bcf

View file

@ -30,23 +30,13 @@ jobs:
TAG="main-${TIMESTAMP}-${SHORT_SHA}" TAG="main-${TIMESTAMP}-${SHORT_SHA}"
echo "tag=${TAG}" >> $GITHUB_OUTPUT echo "tag=${TAG}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
- name: Log in to container registry - name: Log in to container registry
uses: https://github.com/docker/login-action@v3 run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ secrets.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USER }} --password-stdin
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image - name: Build and push Docker image
uses: https://github.com/docker/build-push-action@v6 run: |
with: IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
context: . TAG="${{ steps.tag.outputs.tag }}"
push: true docker build -t "${IMAGE}:${TAG}" -t "${IMAGE}:latest" .
tags: | docker push "${IMAGE}:${TAG}"
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }} docker push "${IMAGE}:latest"
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max