actions - add Docker cache to speedup auto build on the dev branch
This commit is contained in:
parent
b5cd4e0375
commit
29dc64ca30
17
.github/workflows/build-bunkerized-nginx.yml
vendored
17
.github/workflows/build-bunkerized-nginx.yml
vendored
@ -23,6 +23,15 @@ jobs:
|
|||||||
- name: Setup Buildx
|
- name: Setup Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
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
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
@ -37,6 +46,14 @@ jobs:
|
|||||||
platforms: linux/amd64,linux/386,linux/arm/v7,linux/arm64/v8
|
platforms: linux/amd64,linux/386,linux/arm/v7,linux/arm64/v8
|
||||||
push: true
|
push: true
|
||||||
tags: bunkerity/bunkerized-nginx:dev
|
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)
|
- name: Build and push (master)
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<img src="https://img.shields.io/badge/nginx-1.20.1-blue" />
|
<img src="https://img.shields.io/badge/nginx-1.20.1-blue" />
|
||||||
<img src="https://img.shields.io/github/last-commit/bunkerity/bunkerized-nginx" />
|
<img src="https://img.shields.io/github/last-commit/bunkerity/bunkerized-nginx" />
|
||||||
<img src="https://img.shields.io/github/workflow/status/bunkerity/bunkerized-nginx/Automatic%20test?label=automatic%20test" />
|
<img src="https://img.shields.io/github/workflow/status/bunkerity/bunkerized-nginx/Automatic%20test?label=automatic%20test" />
|
||||||
<img src="https://img.shields.io/docker/cloud/build/bunkerity/bunkerized-nginx" />
|
<img src="https://img.shields.io/github/workflow/status/bunkerity/bunkerized-nginx/Build%20and%20push%20bunkerized-nginx?label=docker%20build" />
|
||||||
<img src="https://img.shields.io/readthedocs/bunkerized-nginx" />
|
<img src="https://img.shields.io/readthedocs/bunkerized-nginx" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
@ -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
|
|
||||||
@ -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
|
|
||||||
Loading…
x
Reference in New Issue
Block a user