Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 1m18s
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
REGISTRY: git.danhenry.dev
|
|
IMAGE_NAME: git.danhenry.dev/thelab/work-queue-webui
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ secrets.DOCKER_REGISTRY_USER }}
|
|
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
|
|
|
|
- name: Extract commit SHA
|
|
run: echo "SHA=${GITEA_SHA:0:7}" >> $GITHUB_ENV
|
|
|
|
- name: Build and push multi-arch image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: |
|
|
${{ env.IMAGE_NAME }}:${{ env.SHA }}
|
|
${{ env.IMAGE_NAME }}:latest
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|