57 lines
1.8 KiB
YAML
57 lines
1.8 KiB
YAML
name: Publish on DockerHub
|
|
|
|
on:
|
|
push:
|
|
tags: ['*']
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: docker
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
# The `docker` runner image is node-based and may not ship the docker CLI
|
|
# that the docker/* actions below drive; install it idempotently, as the
|
|
# sibling repos do for their Docker jobs.
|
|
- name: Ensure Docker CLI
|
|
run: |
|
|
set -eux
|
|
if ! command -v docker >/dev/null 2>&1; then
|
|
ARCH=$(uname -m)
|
|
curl -fsSL --retry 3 --retry-connrefused \
|
|
"https://download.docker.com/linux/static/stable/${ARCH}/docker-27.5.1.tgz" \
|
|
| tar xz --strip-components=1 -C /usr/local/bin docker/docker
|
|
fi
|
|
docker --version
|
|
|
|
# Marketplace actions must be referenced by full URL: this instance's
|
|
# DEFAULT_ACTIONS_URL points at code.forgejo.org, so only bare `actions/*`
|
|
# names resolve to GitHub automatically.
|
|
- name: Set up QEMU
|
|
uses: https://github.com/docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: https://github.com/docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Docker Hub
|
|
uses: https://github.com/docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Extract metadata for the Docker image
|
|
id: meta
|
|
uses: https://github.com/docker/metadata-action@v5
|
|
with:
|
|
images: schmelczera/great-ai
|
|
|
|
- name: Build and push
|
|
uses: https://github.com/docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
platforms: linux/amd64,linux/arm64
|