Some checks failed
Build & Push Docker to Gitea Registry / build-and-push (push) Failing after 24s
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: Build & Push Docker to Gitea Registry
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
env:
|
|
REGISTRY: git.quocanh.me
|
|
OWNER: coder-vippro # lowercase!
|
|
IMAGE: chatgpt-discord-bot
|
|
TAG: latest
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest # or use self-hosted runner that can reach your registry
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Debug secrets (temporary)
|
|
run: |
|
|
if [ -z "${{ secrets.REGISTRY_USERNAME }}" ]; then
|
|
echo "REGISTRY_USERNAME is EMPTY"
|
|
exit 1
|
|
else
|
|
echo "REGISTRY_USERNAME is set"
|
|
fi
|
|
|
|
- name: Login to Gitea registry
|
|
run: |
|
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login "${REGISTRY}" -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build & push multi-arch image
|
|
run: |
|
|
docker buildx build \
|
|
--platform linux/amd64,linux/arm64 \
|
|
--tag ${REGISTRY}/${OWNER}/${IMAGE}:${TAG} \
|
|
--push \
|
|
.
|
|
|
|
- name: Verify pushed image (optional)
|
|
run: |
|
|
docker buildx imagetools inspect ${REGISTRY}/${OWNER}/${IMAGE}:${TAG} || true
|