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
|
name: Build & Push Docker to Gitea Registry
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: git.quocanh.me
|
REGISTRY: git.quocanh.me
|
||||||
OWNER: coder-vippro # lowercase!
|
OWNER: coder-vippro
|
||||||
IMAGE: chatgpt-discord-bot
|
IMAGE: chatgpt-discord-bot
|
||||||
TAG: latest
|
TAG: latest
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest # or use self-hosted runner that can reach your registry
|
runs-on: ubuntu-latest # khuyên dùng runner của bạn
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Debug secrets (temporary)
|
steps:
|
||||||
run: |
|
- uses: actions/checkout@v4
|
||||||
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
|
- name: Login to Gitea registry
|
||||||
run: |
|
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
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Build & push multi-arch image
|
- name: Build & push
|
||||||
run: |
|
run: |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
--tag ${REGISTRY}/${OWNER}/${IMAGE}:${TAG} \
|
-t $REGISTRY/$OWNER/$IMAGE:$TAG \
|
||||||
--push \
|
--push \
|
||||||
.
|
.
|
||||||
|
|
||||||
- name: Verify pushed image (optional)
|
|
||||||
run: |
|
|
||||||
docker buildx imagetools inspect ${REGISTRY}/${OWNER}/${IMAGE}:${TAG} || true
|
|
||||||
|
|||||||
Reference in New Issue
Block a user