parent
2dec841cf1
commit
284898dc2f
1 changed files with 10 additions and 6 deletions
|
|
@ -83,9 +83,6 @@ jobs:
|
|||
name: Build and Push Docker Image
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [test-exunit]
|
||||
container:
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
options: --entrypoint=""
|
||||
outputs:
|
||||
image_tag: ${{ steps.tag.outputs.tag }}
|
||||
|
||||
|
|
@ -103,19 +100,26 @@ jobs:
|
|||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||
echo "Full image tag: ${TAG}"
|
||||
|
||||
- name: Install Kaniko
|
||||
run: |
|
||||
curl -fsSL https://github.com/GoogleContainerTools/kaniko/releases/latest/download/executor-linux-amd64 \
|
||||
-o /usr/local/bin/kaniko
|
||||
chmod +x /usr/local/bin/kaniko
|
||||
|
||||
- name: Build and push with Kaniko
|
||||
run: |
|
||||
IMAGE_TAG="${{ steps.tag.outputs.tag }}"
|
||||
REGISTRY_AUTH=$(echo -n "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASSWORD }}" | base64 -w 0)
|
||||
|
||||
mkdir -p /kaniko/.docker
|
||||
mkdir -p /tmp/kaniko-docker
|
||||
echo "{\"auths\":{\"${{ secrets.REGISTRY_URL }}\":{\"auth\":\"${REGISTRY_AUTH}\"}}}" \
|
||||
> /kaniko/.docker/config.json
|
||||
> /tmp/kaniko-docker/config.json
|
||||
|
||||
/kaniko/executor \
|
||||
/usr/local/bin/kaniko \
|
||||
--context="${GITHUB_WORKSPACE}" \
|
||||
--dockerfile="${GITHUB_WORKSPACE}/k8s/Dockerfile" \
|
||||
--build-arg="MIX_ENV=prod" \
|
||||
--docker-config=/tmp/kaniko-docker \
|
||||
--destination="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG}" \
|
||||
--destination="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:production"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue