fix: restore working docker/build-push-action (#213)

Kaniko approach doesn't work on unprivileged runners because even
'docker run' to start the kaniko container requires unshare capabilities.

Restored the docker/build-push-action@v5 which was working before.
The Dockerfile still has Gleam removed - only the build method changed.

Reviewed-on: graham/towerops-web#213
This commit is contained in:
Graham McIntire 2026-03-28 16:13:41 -05:00 committed by graham
parent 0865d59b23
commit 677f5acc9e

View file

@ -113,34 +113,24 @@ jobs:
echo "tag=${TAG}" >> $GITHUB_OUTPUT
echo "Full image tag: ${TAG}"
- name: Build and push with kaniko
run: |
IMAGE_TAG="${{ steps.tag.outputs.tag }}"
- name: Log in to Container Registry
uses: https://github.com/docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
# Create kaniko config for registry auth
mkdir -p /tmp/kaniko
cat > /tmp/kaniko/config.json <<EOF
{
"auths": {
"${{ secrets.REGISTRY_URL }}": {
"auth": "$(echo -n "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASSWORD }}" | base64)"
}
}
}
EOF
# Run kaniko to build and push
docker run --rm \
-v $(pwd):/workspace \
-v /tmp/kaniko:/kaniko/.docker \
gcr.io/kaniko-project/executor:latest \
--context /workspace \
--dockerfile k8s/Dockerfile \
--destination ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG} \
--destination ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:production \
--build-arg MIX_ENV=prod \
--cache=false \
--cleanup
- name: Build and push Docker image
uses: https://github.com/docker/build-push-action@v5
with:
context: .
file: k8s/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:production
build-args: |
MIX_ENV=prod
- name: Update deployment manifest
run: |