From 29dc64ca3080ad89707c737865199da2ac233e01 Mon Sep 17 00:00:00 2001 From: bunkerity Date: Fri, 11 Jun 2021 15:14:10 +0200 Subject: [PATCH] actions - add Docker cache to speedup auto build on the dev branch --- .github/workflows/build-bunkerized-nginx.yml | 17 +++++++++++++++++ README.md | 2 +- hooks/post_push | 12 ------------ hooks/pre_build | 5 ----- 4 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 hooks/post_push delete mode 100644 hooks/pre_build diff --git a/.github/workflows/build-bunkerized-nginx.yml b/.github/workflows/build-bunkerized-nginx.yml index c1232a5..35312a7 100644 --- a/.github/workflows/build-bunkerized-nginx.yml +++ b/.github/workflows/build-bunkerized-nginx.yml @@ -23,6 +23,15 @@ jobs: - name: Setup Buildx uses: docker/setup-buildx-action@v1 + - name: Setup Docker cache + uses: actions/cache@v2 + if: github.ref == 'refs/heads/dev' + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Login to Docker Hub uses: docker/login-action@v1 with: @@ -37,6 +46,14 @@ jobs: platforms: linux/amd64,linux/386,linux/arm/v7,linux/arm64/v8 push: true tags: bunkerity/bunkerized-nginx:dev + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new + + - name: Move Docker cache + if: github.ref == 'refs/heads/dev' + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: Build and push (master) uses: docker/build-push-action@v2 diff --git a/README.md b/README.md index 3dc6071..0947dc1 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - +

diff --git a/hooks/post_push b/hooks/post_push deleted file mode 100644 index 4c8845a..0000000 --- a/hooks/post_push +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -curl -Lo manifest-tool https://github.com/estesp/manifest-tool/releases/download/v1.0.3/manifest-tool-linux-amd64 -chmod +x manifest-tool - -VERSION=$(cat VERSION | tr -d '\n') -if [ "$SOURCE_BRANCH" = "dev" ] ; then - ./manifest-tool push from-args --ignore-missing --platforms linux/amd64,linux/386,linux/arm/v7,linux/arm64/v8 --template bunkerity/bunkerized-nginx:dev-ARCHVARIANT --target bunkerity/bunkerized-nginx:dev -elif [ "$SOURCE_BRANCH" = "master" ] ; then - ./manifest-tool push from-args --ignore-missing --platforms linux/amd64,linux/386,linux/arm/v7,linux/arm64/v8 --template bunkerity/bunkerized-nginx:ARCHVARIANT --target bunkerity/bunkerized-nginx:${VERSION} - ./manifest-tool push from-args --ignore-missing --platforms linux/amd64,linux/386,linux/arm/v7,linux/arm64/v8 --template bunkerity/bunkerized-nginx:ARCHVARIANT --target bunkerity/bunkerized-nginx:latest -fi diff --git a/hooks/pre_build b/hooks/pre_build deleted file mode 100644 index acf05f1..0000000 --- a/hooks/pre_build +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Register qemu-*-static for all supported processors except the -# current one, but also remove all registered binfmt_misc before -docker run --rm --privileged multiarch/qemu-user-static:register --reset