Some checks failed
Build and Push Backend / build (push) Failing after 5s
Kaniko doesn't require Docker daemon, works better in K8s Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
36 lines
1.0 KiB
YAML
36 lines
1.0 KiB
YAML
name: Build and Push Backend
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: gcr.io/kaniko-project/executor:debug
|
|
options: --privileged
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Prepare Kaniko config
|
|
run: |
|
|
mkdir -p /kaniko/.docker
|
|
echo "{\"auths\":{\"git.fuq.tv\":{\"auth\":\"$(echo -n admin:${{ secrets.REGISTRY_TOKEN }} | base64)\"}}}" > /kaniko/.docker/config.json
|
|
|
|
- name: Build and push with Kaniko
|
|
run: |
|
|
/kaniko/executor \
|
|
--context=$GITHUB_WORKSPACE \
|
|
--dockerfile=Dockerfile \
|
|
--destination=git.fuq.tv/admin/aiworker-backend:latest \
|
|
--destination=git.fuq.tv/admin/aiworker-backend:${GITHUB_SHA::7} \
|
|
--cache=true \
|
|
--cache-repo=git.fuq.tv/admin/aiworker-backend/cache
|
|
|
|
- name: Image pushed
|
|
run: echo "Image pushed to git.fuq.tv/admin/aiworker-backend:latest"
|