Try Docker Buildx with Kubernetes driver
Build and Push Docker Image / build_and_push (push) Failing after 21s Details

This commit is contained in:
Arnaud Delcasse 2024-03-24 23:02:53 +01:00
parent 170b599f54
commit 9486551ee5
1 changed files with 42 additions and 19 deletions

View File

@ -7,33 +7,56 @@ on:
- dev - dev
jobs: jobs:
checkout_repository: build_and_push:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Test Gitea - uses: azure/k8s-set-context@v4
run: | with:
echo "GITEA_Actor: ${{gitea.actor}}" method: kubeconfig
echo "GITEA_Repository: ${{gitea.repository}}" kubeconfig: ${{secrets.buildx_kubeconfig}}
echo "GITEA_REF_NAME: ${{gitea.ref_name}}"
echo "REGISTRY_USER: ${{secrets.registry_user}}" - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# KANIKO with:
- name: Kaniko build and push driver: kubernetes
uses: aevea/action-kaniko@master driver-opts: |
namespace=gitea
- name: Login to Docker Registry
uses: docker/login-action@v3
with: with:
build_file: Dockerfile
registry: git.coopgo.io registry: git.coopgo.io
username: ${{secrets.registry_user}} username: ${{ secrets.REGISTRY_USER }}
password: ${{secrets.registry_token}} password: ${{ secrets.REGISTRY_TOKEN }}
image: ${{gitea.repository}}
tag: ${{gitea.ref_name}} - name: Build and push
cache: true uses: docker/build-push-action@v5
cache_registry: git.coopgo.io/${{gitea.repository}}/cache with:
extra-args: | context: .
push: true
tags: |
git.coopgo.io/${{gitea.repository}}:${{gitea.ref_name}}
build-args: |
ACCESS_TOKEN_USR=${{gitea.actor}} ACCESS_TOKEN_USR=${{gitea.actor}}
ACCESS_TOKEN_PWD=${{gitea.token}} ACCESS_TOKEN_PWD=${{gitea.token}}
# BUILD WITH KANIKO
# - name: Kaniko build and push
# uses: aevea/action-kaniko@master
# with:
# build_file: Dockerfile
# registry: git.coopgo.io
# username: ${{secrets.registry_user}}
# password: ${{secrets.registry_token}}
# image: ${{gitea.repository}}
# tag: ${{gitea.ref_name}}
# cache: true
# cache_registry: git.coopgo.io/${{gitea.repository}}/cache
# extra-args: |
# ACCESS_TOKEN_USR=${{gitea.actor}}
# ACCESS_TOKEN_PWD=${{gitea.token}}