Update .github/workflows/main.yml
Some checks failed
Build & Push Docker to Gitea Registry / build-and-push (push) Failing after 7s
Some checks failed
Build & Push Docker to Gitea Registry / build-and-push (push) Failing after 7s
This commit is contained in:
37
.github/workflows/main.yml
vendored
37
.github/workflows/main.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user