Skip to content

Commit c0e3bc7

Browse files
committed
Use v2 of the docker build-push-action for ci base images
Also leverage github actions caching
1 parent 7adf079 commit c0e3bc7

File tree

2 files changed

+63
-31
lines changed

2 files changed

+63
-31
lines changed

.github/workflows/base-images.yaml

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,39 @@ jobs:
1414
steps:
1515
- name: CHECKOUT REPOSITORY
1616
uses: actions/checkout@v2
17-
- name: CREATE ERLANG+ELIXIR IMAGE (${{ matrix.erlang_version }})
18-
uses: docker/build-push-action@v1
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v1
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v1
21+
- name: Cache Docker layers
22+
uses: actions/cache@v2
23+
with:
24+
path: /tmp/.buildx-cache
25+
key: ${{ runner.os }}-buildx-${{ github.sha }}
26+
restore-keys: |
27+
${{ runner.os }}-buildx-
28+
- name: Login to DockerHub
29+
uses: docker/login-action@v1
1930
with:
31+
registry: eu.gcr.io
2032
username: _json_key
2133
password: ${{ secrets.GCR_JSON_KEY }}
22-
registry: eu.gcr.io
23-
repository: cf-rabbitmq-core/erlang_elixir
24-
dockerfile: ci/dockerfiles/${{ matrix.erlang_version }}/erlang_elixir
25-
tags: ${{ matrix.erlang_version }}
34+
- name: CREATE ERLANG+ELIXIR IMAGE (${{ matrix.erlang_version }})
35+
uses: docker/build-push-action@v2
36+
with:
37+
push: true
38+
file: ci/dockerfiles/${{ matrix.erlang_version }}/erlang_elixir
39+
tags: eu.gcr.io/cf-rabbitmq-core/erlang_elixir:${{ matrix.erlang_version }}
40+
cache-from: type=local,src=/tmp/.buildx-cache
41+
cache-to: type=local,dest=/tmp/.buildx-cache
2642
- name: CREATE BASE CI IMAGE (${{ matrix.erlang_version }})
27-
uses: docker/build-push-action@v1
43+
uses: docker/build-push-action@v2
2844
with:
29-
username: _json_key
30-
password: ${{ secrets.GCR_JSON_KEY }}
31-
registry: eu.gcr.io
32-
repository: cf-rabbitmq-core/ci-base
33-
dockerfile: ci/dockerfiles/ci-base
34-
build_args: ERLANG_VERSION=${{ matrix.erlang_version }},SECONDARY_UMBRELLA_GITREFS=v3.7.28 v3.8.9
35-
tags: ${{ matrix.erlang_version }}
45+
push: true
46+
file: ci/dockerfiles/ci-base
47+
build-args: |
48+
ERLANG_VERSION=${{ matrix.erlang_version }}
49+
SECONDARY_UMBRELLA_GITREFS=v3.7.28 v3.8.9
50+
tags: eu.gcr.io/cf-rabbitmq-core/ci-base:${{ matrix.erlang_version }}
51+
cache-from: type=local,src=/tmp/.buildx-cache
52+
cache-to: type=local,dest=/tmp/.buildx-cache

workflow_sources/base_image/workflow.yml

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,40 @@ jobs:
1919
steps:
2020
- name: CHECKOUT REPOSITORY
2121
uses: actions/checkout@v2
22-
- name: CREATE ERLANG+ELIXIR IMAGE (${{ matrix.erlang_version }})
23-
uses: docker/build-push-action@v1
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v1
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v1
26+
- name: Cache Docker layers
27+
uses: actions/cache@v2
28+
with:
29+
path: /tmp/.buildx-cache
30+
key: ${{ runner.os }}-buildx-${{ github.sha }}
31+
restore-keys: |
32+
${{ runner.os }}-buildx-
33+
- name: Login to DockerHub
34+
uses: docker/login-action@v1
2435
with:
36+
registry: eu.gcr.io
2537
username: _json_key
2638
password: ${{ secrets.GCR_JSON_KEY }}
27-
registry: eu.gcr.io
28-
repository: cf-rabbitmq-core/erlang_elixir
29-
dockerfile: ci/dockerfiles/${{ matrix.erlang_version }}/erlang_elixir
30-
tags: ${{ matrix.erlang_version }}
39+
- name: CREATE ERLANG+ELIXIR IMAGE (${{ matrix.erlang_version }})
40+
uses: docker/build-push-action@v2
41+
with:
42+
push: true
43+
file: ci/dockerfiles/${{ matrix.erlang_version }}/erlang_elixir
44+
tags: eu.gcr.io/cf-rabbitmq-core/erlang_elixir:${{ matrix.erlang_version }}
45+
cache-from: type=local,src=/tmp/.buildx-cache
46+
cache-to: type=local,dest=/tmp/.buildx-cache
3147
- name: CREATE BASE CI IMAGE (${{ matrix.erlang_version }})
32-
uses: docker/build-push-action@v1
48+
uses: docker/build-push-action@v2
3349
with:
34-
username: _json_key
35-
password: ${{ secrets.GCR_JSON_KEY }}
36-
registry: eu.gcr.io
37-
repository: cf-rabbitmq-core/ci-base
38-
dockerfile: ci/dockerfiles/ci-base
39-
#@ build_args = {}
40-
#@ build_args["ERLANG_VERSION"] = "${{ matrix.erlang_version }}"
41-
#@ build_args["SECONDARY_UMBRELLA_GITREFS"] = ' '.join(data.values.secondary_umbrella_gitrefs)
42-
build_args: #@ to_build_args(build_args)
43-
tags: ${{ matrix.erlang_version }}
50+
push: true
51+
file: ci/dockerfiles/ci-base
52+
#@yaml/text-templated-strings
53+
build-args: |
54+
ERLANG_VERSION=${{ matrix.erlang_version }}
55+
SECONDARY_UMBRELLA_GITREFS=(@= ' '.join(data.values.secondary_umbrella_gitrefs) @)
56+
tags: eu.gcr.io/cf-rabbitmq-core/ci-base:${{ matrix.erlang_version }}
57+
cache-from: type=local,src=/tmp/.buildx-cache
58+
cache-to: type=local,dest=/tmp/.buildx-cache

0 commit comments

Comments
 (0)