diff options
author | Philip Kuryloski <kuryloskip@vmware.com> | 2020-12-08 16:36:09 +0100 |
---|---|---|
committer | Philip Kuryloski <kuryloskip@vmware.com> | 2020-12-09 11:24:36 +0100 |
commit | c0e3bc7e61fa0e07c5b5c5be40e3621661b60c4d (patch) | |
tree | f1995441221d08681b044057f1e45a5744e27665 | |
parent | 7adf079436d165f978cfc67f14c62ed17c0021fe (diff) | |
download | rabbitmq-server-git-c0e3bc7e61fa0e07c5b5c5be40e3621661b60c4d.tar.gz |
Use v2 of the docker build-push-action for ci base images
Also leverage github actions caching
-rw-r--r-- | .github/workflows/base-images.yaml | 45 | ||||
-rw-r--r-- | workflow_sources/base_image/workflow.yml | 49 |
2 files changed, 63 insertions, 31 deletions
diff --git a/.github/workflows/base-images.yaml b/.github/workflows/base-images.yaml index 674968e0c8..2ed2fd4992 100644 --- a/.github/workflows/base-images.yaml +++ b/.github/workflows/base-images.yaml @@ -14,22 +14,39 @@ jobs: steps: - name: CHECKOUT REPOSITORY uses: actions/checkout@v2 - - name: CREATE ERLANG+ELIXIR IMAGE (${{ matrix.erlang_version }}) - uses: docker/build-push-action@v1 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Login to DockerHub + uses: docker/login-action@v1 with: + registry: eu.gcr.io username: _json_key password: ${{ secrets.GCR_JSON_KEY }} - registry: eu.gcr.io - repository: cf-rabbitmq-core/erlang_elixir - dockerfile: ci/dockerfiles/${{ matrix.erlang_version }}/erlang_elixir - tags: ${{ matrix.erlang_version }} + - name: CREATE ERLANG+ELIXIR IMAGE (${{ matrix.erlang_version }}) + uses: docker/build-push-action@v2 + with: + push: true + file: ci/dockerfiles/${{ matrix.erlang_version }}/erlang_elixir + tags: eu.gcr.io/cf-rabbitmq-core/erlang_elixir:${{ matrix.erlang_version }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache - name: CREATE BASE CI IMAGE (${{ matrix.erlang_version }}) - uses: docker/build-push-action@v1 + uses: docker/build-push-action@v2 with: - username: _json_key - password: ${{ secrets.GCR_JSON_KEY }} - registry: eu.gcr.io - repository: cf-rabbitmq-core/ci-base - dockerfile: ci/dockerfiles/ci-base - build_args: ERLANG_VERSION=${{ matrix.erlang_version }},SECONDARY_UMBRELLA_GITREFS=v3.7.28 v3.8.9 - tags: ${{ matrix.erlang_version }} + push: true + file: ci/dockerfiles/ci-base + build-args: | + ERLANG_VERSION=${{ matrix.erlang_version }} + SECONDARY_UMBRELLA_GITREFS=v3.7.28 v3.8.9 + tags: eu.gcr.io/cf-rabbitmq-core/ci-base:${{ matrix.erlang_version }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache diff --git a/workflow_sources/base_image/workflow.yml b/workflow_sources/base_image/workflow.yml index f5e86b7827..9911228b1e 100644 --- a/workflow_sources/base_image/workflow.yml +++ b/workflow_sources/base_image/workflow.yml @@ -19,25 +19,40 @@ jobs: steps: - name: CHECKOUT REPOSITORY uses: actions/checkout@v2 - - name: CREATE ERLANG+ELIXIR IMAGE (${{ matrix.erlang_version }}) - uses: docker/build-push-action@v1 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Login to DockerHub + uses: docker/login-action@v1 with: + registry: eu.gcr.io username: _json_key password: ${{ secrets.GCR_JSON_KEY }} - registry: eu.gcr.io - repository: cf-rabbitmq-core/erlang_elixir - dockerfile: ci/dockerfiles/${{ matrix.erlang_version }}/erlang_elixir - tags: ${{ matrix.erlang_version }} + - name: CREATE ERLANG+ELIXIR IMAGE (${{ matrix.erlang_version }}) + uses: docker/build-push-action@v2 + with: + push: true + file: ci/dockerfiles/${{ matrix.erlang_version }}/erlang_elixir + tags: eu.gcr.io/cf-rabbitmq-core/erlang_elixir:${{ matrix.erlang_version }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache - name: CREATE BASE CI IMAGE (${{ matrix.erlang_version }}) - uses: docker/build-push-action@v1 + uses: docker/build-push-action@v2 with: - username: _json_key - password: ${{ secrets.GCR_JSON_KEY }} - registry: eu.gcr.io - repository: cf-rabbitmq-core/ci-base - dockerfile: ci/dockerfiles/ci-base - #@ build_args = {} - #@ build_args["ERLANG_VERSION"] = "${{ matrix.erlang_version }}" - #@ build_args["SECONDARY_UMBRELLA_GITREFS"] = ' '.join(data.values.secondary_umbrella_gitrefs) - build_args: #@ to_build_args(build_args) - tags: ${{ matrix.erlang_version }} + push: true + file: ci/dockerfiles/ci-base + #@yaml/text-templated-strings + build-args: | + ERLANG_VERSION=${{ matrix.erlang_version }} + SECONDARY_UMBRELLA_GITREFS=(@= ' '.join(data.values.secondary_umbrella_gitrefs) @) + tags: eu.gcr.io/cf-rabbitmq-core/ci-base:${{ matrix.erlang_version }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache |