Build Docker Images #1806
This file contains hidden or 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: | |
| schedule: | |
| - cron: '0 0 * * *' # Run Daily | |
| workflow_dispatch: | |
| env: | |
| DOCKER_ORG: cormorack | |
| GITHUB_SHA: ${{ github.sha }} | |
| jobs: | |
| docker-build: | |
| name: ${{ matrix.image_name }}-build | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| image_name: ["minioci"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - run: df -h | |
| - name: Free disk space | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| tool-cache: true | |
| swap-storage: true | |
| - run: df -h | |
| - name: Docker prune | |
| run: | | |
| docker buildx prune -af --filter until=24h || true # keep super-recent cache | |
| docker system prune -af || true | |
| - name: Retrieve test data | |
| if: matrix.image_name == 'http' | |
| uses: ./.github/actions/gdrive-rclone | |
| env: | |
| GOOGLE_SERVICE_JSON: ${{ secrets.GOOGLE_SERVICE_JSON }} | |
| ROOT_FOLDER_ID: ${{ secrets.TEST_DATA_FOLDER_ID }} | |
| - name: Set Docker Image Spec | |
| run: | | |
| DATE_TAG="$( date -u '+%Y.%m.%d' )" | |
| IMAGE_SPEC="${{ env.DOCKER_ORG }}/${{ matrix.image_name }}" | |
| echo "IMAGE_SPEC=${IMAGE_SPEC}" >> $GITHUB_ENV | |
| echo "DATE_TAG=${DATE_TAG}" >> $GITHUB_ENV | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_TOKEN }} | |
| - name: Build and push | |
| id: docker_build_push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./ | |
| file: ./.ci_helpers/docker/${{ matrix.image_name }}.dockerfile | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: | | |
| ${{ env.IMAGE_SPEC }}:${{ env.DATE_TAG }} | |
| ${{ env.IMAGE_SPEC }}:latest |