ci(cross-build-package): docker build with cache
This commit is contained in:
parent
7520620a08
commit
5312aa4a93
|
@ -386,6 +386,9 @@ jobs:
|
||||||
# NOTE: for docker, only support latest otp version, not a matrix
|
# NOTE: for docker, only support latest otp version, not a matrix
|
||||||
otp:
|
otp:
|
||||||
- 24.1.5-3 # update to latest
|
- 24.1.5-3 # update to latest
|
||||||
|
arch:
|
||||||
|
- amd64
|
||||||
|
- arm64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v2
|
||||||
|
@ -417,12 +420,37 @@ jobs:
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Get deps git refs for cache
|
||||||
|
id: deps-refs
|
||||||
|
run: |
|
||||||
|
cd source
|
||||||
|
make ensure-rebar3
|
||||||
|
sudo cp rebar3 /usr/local/bin/rebar3
|
||||||
|
rebar3 get-deps
|
||||||
|
RocksDBRef=$(erl -noshell -eval '{ok,Raw}=file:consult("rebar.lock"), {_Vsn, Deps}=hd(Raw), {_, {git, _Url, {ref, Ref}},_} = lists:keyfind(<<"rocksdb">>,1, Deps), io:format("~s",[Ref]), init:stop().')
|
||||||
|
echo "::set-output name=DEP_ROCKSDB_REF::${RocksDBRef}"
|
||||||
|
QuicerRef=$(erl -noshell -eval '{ok,Raw}=file:consult("rebar.lock"), {_Vsn, Deps}=hd(Raw), {_, {git, _Url, {ref, Ref}},_} = lists:keyfind(<<"quicer">>,1, Deps), io:format("~s",[Ref]), init:stop().')
|
||||||
|
echo "::set-output name=DEP_QUICER_REF::${QuicerRef}"
|
||||||
|
make clean-all
|
||||||
|
|
||||||
|
- name: load rocksdb cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: source/_build/default/lib/rocksdb/
|
||||||
|
key: alpine3.14-${{ matrix.otp }}-${{ matrix.arch }}-${{ steps.deps-refs.outputs.DEP_ROCKSDB_REF }}
|
||||||
|
- name: load quicer cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: source/_build/default/lib/quicer/
|
||||||
|
key: alpine3.14-${{ matrix.otp }}-${{ matrix.arch }}-${{ steps.deps-refs.outputs.DEP_QUICER_REF }}
|
||||||
|
|
||||||
- uses: docker/build-push-action@v2
|
- uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
push: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
|
push: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
|
||||||
pull: true
|
pull: true
|
||||||
no-cache: true
|
no-cache: true
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/${{ matrix.arch }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
build-args: |
|
build-args: |
|
||||||
|
|
Loading…
Reference in New Issue