name: Update CI docker image on: pull_request: paths: - 'docker/ci/**' - 'docker/compilers/**' - .github/workflows/update_docker_ci.yml push: branches: [develop] paths: - 'docker/ci/**' # CI image must update when either its dockerfile changes - 'docker/compilers/**' # or any compilers changed and were pushed by hand - .github/workflows/update_docker_ci.yml workflow_dispatch: jobs: build_and_push: name: Build and push docker image runs-on: [self-hosted, heavy] steps: - name: Login to DockerHub if: ${{ github.event_name != 'pull_request' }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_PW }} - uses: actions/checkout@v4 - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 - uses: docker/metadata-action@v5 id: meta with: images: rippleci/clio_ci tags: | type=raw,value=latest type=raw,value=gcc_12_clang_16 type=raw,value=${{ env.GITHUB_SHA }} - name: Build and push uses: docker/build-push-action@v5 with: context: ${{ github.workspace }}/docker/ci platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }}