Update .gitea/workflows/build-and-push.yaml
Some checks failed
Build and Push Container Image / build-and-push (push) Failing after 10s
Some checks failed
Build and Push Container Image / build-and-push (push) Failing after 10s
This commit is contained in:
@@ -7,16 +7,9 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY: ${{ gitea.server_url }}
|
|
||||||
IMAGE_NAME: ${{ gitea.repository }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: orchestration-platform
|
runs-on: orchestration-platform
|
||||||
container:
|
|
||||||
image: gcr.io/kaniko-project/executor:debug
|
|
||||||
options: --entrypoint=""
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -32,24 +25,12 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Login to Gitea registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ gitea.server_url }} -u ${{ gitea.actor }} --password-stdin
|
||||||
|
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
run: |
|
run: |
|
||||||
REGISTRY_HOST=$(echo "${REGISTRY}" | sed 's|https\?://||')
|
IMAGE="${{ gitea.server_url }}/${{ gitea.repository }}:${{ steps.meta.outputs.tag }}"
|
||||||
AUTH=$(echo -n "${{ gitea.actor }}:${{ secrets.REGISTRY_TOKEN }}" | base64)
|
docker build -t "${IMAGE}" .
|
||||||
|
docker push "${IMAGE}"
|
||||||
mkdir -p /kaniko/.docker
|
|
||||||
cat > /kaniko/.docker/config.json <<EOF
|
|
||||||
{
|
|
||||||
"auths": {
|
|
||||||
"${REGISTRY_HOST}": {
|
|
||||||
"auth": "${AUTH}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
/kaniko/executor \
|
|
||||||
--context "${GITHUB_WORKSPACE}" \
|
|
||||||
--dockerfile "${GITHUB_WORKSPACE}/Dockerfile" \
|
|
||||||
--destination "${REGISTRY_HOST}/${IMAGE_NAME}:${{ steps.meta.outputs.tag }}" \
|
|
||||||
--cache=true
|
|
||||||
Reference in New Issue
Block a user