Push Docker Images to Multiple Registries #31
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: Push Docker Images to Multiple Registries | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
schedule: | |
- cron: '0 2 */7 * *' | |
env: | |
LOG_LEVEL: "${{ vars.LOG_LEVEL }}" | |
PRIVATE_REGISTRY_URLS: "${{ secrets.PRIVATE_REGISTRY_URLS }}" | |
PRIVATE_REGISTRY_USERNAME: "${{ secrets.PRIVATE_REGISTRY_USERNAME }}" | |
PRIVATE_REGISTRY_PASSWORD: "${{ secrets.PRIVATE_REGISTRY_PASSWORD }}" | |
DOCKER_USERNAME: "${{ secrets.DOCKER_USERNAME }}" | |
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" | |
jobs: | |
push-to-registries: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Maximize build space | |
uses: easimon/maximize-build-space@master | |
with: | |
root-reserve-mb: 2048 | |
swap-size-mb: 128 | |
remove-android: 'true' | |
remove-docker-images: 'true' | |
remove-dotnet: 'true' | |
remove-haskell: 'true' | |
remove-codeql: 'true' | |
build-mount-path: '/var/lib/docker' | |
- name: Restart docker | |
run: sudo service docker restart | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Image Sync To Registry | |
id: read-images | |
run: | | |
bash docker-image-pusher.sh | |