add docker_kit (#1) #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-docker-images | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- "*.md" | |
pull_request: | |
branches: [ main ] | |
paths-ignore: | |
- "*.md" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
REGISTRY_URL: "docker.io" # docker.io or other registry URL, DOCKER_REGISTRY_USER/DOCKER_REGISTRY_PASSWORD to be set in CI env. | |
BUILDKIT_PROGRESS: "plain" # Full logs for CI build. | |
# DOCKER_REGISTRY_USER and DOCKER_REGISTRY_PASSWORD is required for docker image push, they should be set in CI secrets. | |
DOCKER_REGISTRY_USER: ${{ secrets.DOCKER_REGISTRY_USER }} | |
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
# used to sync image to mirror registry | |
DOCKER_MIRROR_REGISTRY_USERNAME: ${{ secrets.DOCKER_MIRROR_REGISTRY_USERNAME }} | |
DOCKER_MIRROR_REGISTRY_PASSWORD: ${{ secrets.DOCKER_MIRROR_REGISTRY_PASSWORD }} | |
jobs: | |
docker_kit: | |
name: 'docker-kit' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
source ./tool.sh && build_image docker-kit latest docker_docker_kit/Dockerfile && push_image | |
sync_images: | |
needs: ['docker_kit'] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
source ./tool.sh | |
setup_docker_syncer | |
echo "Syncing image to mirror registry..." | |
python docker_docker_kit/work/image-syncer/run_jobs.py |