Skip to content

feat: init ci

feat: init ci #9

Workflow file for this run

name: Galaxio Docker Images Building
on:
push:
branches:
- main
tags:
- '*'
env:
KANIKO_CACHE_ARGS: "--cache=true --cache-copy-layers=true --cache-ttl=24h"
jobs:
test-build:
runs-on: ubuntu-22.04
container:
image: gcr.io/kaniko-project/executor:v1.20.0-debug
permissions:
contents: read # read the repository
steps:
- name: Test Build with kaniko
run: |
/kaniko/executor --dockerfile="Dockerfile" \
--context="${{ github.repositoryUrl }}#${{ github.ref }}#${{ github.sha }}" \
--no-push \
--cleanup
build:
runs-on: ubuntu-22.04
container:
image: gcr.io/kaniko-project/executor:v1.20.0-debug
permissions:
contents: read # read the repository
needs: test-build
steps:
- name: Build and Push Image to docker registry with kaniko
run: |
cat <<EOF > /kaniko/.docker/config.json
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "$(echo -n "${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }}" | base64 )"
}
}
}
EOF
rm -rf .git
/kaniko/executor --dockerfile="Dockerfile" \
--context="${{ github.repositoryUrl }}#${{ github.ref }}#${{ github.sha }}" \
--destination="$DOCKER_IMAGE_NAME:master" \
--destination="$DOCKER_IMAGE_NAME:latest" \
${{ env.KANIKO_CACHE_ARGS }} \
--push-retry 5
env:
GIT_USERNAME: ${{ github.actor }}
GIT_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_IMAGE_NAME: "galaxio/base-image"