Update .gitea/workflows/build-and-push.yaml
Some checks failed
Build and Push Container Image / build-and-push (push) Failing after 11s
Some checks failed
Build and Push Container Image / build-and-push (push) Failing after 11s
This commit is contained in:
@@ -7,6 +7,10 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Internal Gitea service URL — bypasses nginx, avoids /v2/ routing issue
|
||||||
|
INTERNAL_REGISTRY: gitea-http.gitea.svc.cluster.local:3000
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: orchestration-platform
|
runs-on: orchestration-platform
|
||||||
@@ -17,7 +21,6 @@ jobs:
|
|||||||
- name: Install tools
|
- name: Install tools
|
||||||
run: |
|
run: |
|
||||||
apk add --no-cache git curl
|
apk add --no-cache git curl
|
||||||
# Install crane for pushing to insecure registries
|
|
||||||
curl -sL https://github.com/google/go-containerregistry/releases/latest/download/go-containerregistry_Linux_x86_64.tar.gz | tar -xz -C /usr/local/bin crane
|
curl -sL https://github.com/google/go-containerregistry/releases/latest/download/go-containerregistry_Linux_x86_64.tar.gz | tar -xz -C /usr/local/bin crane
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -36,14 +39,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Build image
|
- name: Build image
|
||||||
run: |
|
run: |
|
||||||
REGISTRY_HOST=$(echo "${{ gitea.server_url }}" | sed 's|https\?://||')
|
IMAGE="${INTERNAL_REGISTRY}/${{ gitea.repository }}:${{ steps.meta.outputs.tag }}"
|
||||||
IMAGE="${REGISTRY_HOST}/${{ gitea.repository }}:${{ steps.meta.outputs.tag }}"
|
|
||||||
docker build -t "${IMAGE}" .
|
docker build -t "${IMAGE}" .
|
||||||
docker save "${IMAGE}" -o image.tar
|
docker save "${IMAGE}" -o image.tar
|
||||||
|
|
||||||
- name: Push image
|
- name: Push image
|
||||||
run: |
|
run: |
|
||||||
REGISTRY_HOST=$(echo "${{ gitea.server_url }}" | sed 's|https\?://||')
|
IMAGE="${INTERNAL_REGISTRY}/${{ gitea.repository }}:${{ steps.meta.outputs.tag }}"
|
||||||
IMAGE="${REGISTRY_HOST}/${{ gitea.repository }}:${{ steps.meta.outputs.tag }}"
|
crane auth login "${INTERNAL_REGISTRY}" -u "${{ gitea.actor }}" -p "${{ secrets.REGISTRY_TOKEN }}" --insecure
|
||||||
crane auth login "${REGISTRY_HOST}" -u "${{ gitea.actor }}" -p "${{ secrets.REGISTRY_TOKEN }}" --insecure
|
|
||||||
crane push image.tar "${IMAGE}" --insecure
|
crane push image.tar "${IMAGE}" --insecure
|
||||||
Reference in New Issue
Block a user