Update .github/workflows/main.yml
Some checks failed
Build & Push Docker to Gitea Registry / build-and-push (push) Failing after 7s

This commit is contained in:
2025-12-24 00:08:39 +07:00
parent bbedb98ce0
commit 4c628443c8

View File

@@ -1,48 +1,37 @@
name: Build & Push Docker to Gitea Registry
on:
workflow_dispatch:
push:
branches: [ main ]
workflow_dispatch:
env:
REGISTRY: git.quocanh.me
OWNER: coder-vippro # lowercase!
OWNER: coder-vippro
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
runs-on: ubuntu-latest # khuyên dùng runner của bạn
- 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
steps:
- uses: actions/checkout@v4
- name: Login to Gitea registry
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login "${REGISTRY}" -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
echo "${{ secrets.REGISTRY_PASSWORD }}" \
| docker login "$REGISTRY" \
-u "${{ secrets.REGISTRY_USERNAME }}" \
--password-stdin
- name: Set up Docker Buildx
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Build & push multi-arch image
- name: Build & push
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ${REGISTRY}/${OWNER}/${IMAGE}:${TAG} \
-t $REGISTRY/$OWNER/$IMAGE:$TAG \
--push \
.
- name: Verify pushed image (optional)
run: |
docker buildx imagetools inspect ${REGISTRY}/${OWNER}/${IMAGE}:${TAG} || true