test
Build and Push Docker Image / build-and-push (push) Failing after 5s Details

This commit is contained in:
Nicolas CARON 2024-03-20 11:50:21 +01:00
parent bac39121bd
commit ce9f17735c
1 changed files with 6 additions and 4 deletions

View File

@ -9,7 +9,6 @@ on:
jobs:
build-and-push:
runs-on: ubuntu-latest
container: gcr.io/kaniko-project/executor
steps:
- name: Checkout repository
uses: actions/checkout@v2
@ -17,9 +16,12 @@ jobs:
- name: Build and Push Docker Image
run: |
mkdir -p /kaniko/.docker
echo "{\"auths\":{\"$DOCKER_REGISTRY\":{\"username\":\"$DOCKER_USERNAME\",\"password\":\"$DOCKER_PASSWORD\",\"auth\":\"$(echo -n "$DOCKER_USERNAME:$DOCKER_PASSWORD" | base64)\"}}}" > /kaniko/.docker/config.json
/kaniko/executor --context $GITHUB_WORKSPACE --dockerfile $GITHUB_WORKSPACE/Dockerfile --destination $DOCKER_REGISTRY/$IMAGE_NAME:$IMAGE_TAG
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd):/workspace \
gcr.io/kaniko-project/executor:latest \
--dockerfile /workspace/Dockerfile \
--destination $DOCKER_REGISTRY/$IMAGE_NAME:$IMAGE_TAG
env:
DOCKER_REGISTRY: git.coopgo.io
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}