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:
|
||||
- "v*"
|
||||
|
||||
env:
|
||||
REGISTRY: ${{ gitea.server_url }}
|
||||
IMAGE_NAME: ${{ gitea.repository }}
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: orchestration-platform
|
||||
container:
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
options: --entrypoint=""
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -32,24 +25,12 @@ jobs:
|
||||
fi
|
||||
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
|
||||
run: |
|
||||
REGISTRY_HOST=$(echo "${REGISTRY}" | sed 's|https\?://||')
|
||||
AUTH=$(echo -n "${{ gitea.actor }}:${{ secrets.REGISTRY_TOKEN }}" | base64)
|
||||
|
||||
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
|
||||
IMAGE="${{ gitea.server_url }}/${{ gitea.repository }}:${{ steps.meta.outputs.tag }}"
|
||||
docker build -t "${IMAGE}" .
|
||||
docker push "${IMAGE}"
|
||||
Reference in New Issue
Block a user