Skip to content

Bump actions/cache from 2 to 4 #6

Bump actions/cache from 2 to 4

Bump actions/cache from 2 to 4 #6

Workflow file for this run

name: Docker image
on:
push:
branches: [ 'master' ]
jobs:
buildx:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Get release version
id: version_number
shell: bash
run: |
echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "::set-output name=RELEASE_VERSION::${GITHUB_REF:10}"
export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV
echo "::set-output name=BUILD_DATE::${BUILD_DATE}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
with:
install: true
- name: Builder info
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-pg13-${{ hashFiles('**/Dockerfile', 'files/*', 'runtime/*', '*.sh') }}
restore-keys: |
${{ runner.os }}-single-buildx-
${{ runner.os }}-pg14-
${{ runner.os }}-pg13-
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: 'boky'
password: '${{ secrets.DOCKER_ACCESS_TOKEN }}'
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
boky/alpine-bootstrap:latest
platforms: "linux/amd64,linux/arm64"
cache-from: type=local,src=/tmp/.buildx-cache/
cache-to: type=local,dest=/tmp/.buildx-cache-new/
build-args: |
ALPINE_VERSION=alpine:latest
PG_VERSION=13.5
VCS_REF=${{ steps.version_number.outputs.RELEASE_VERSION }}
BUILD_DATE=${{ steps.version_number.outputs.BUILD_DATE }}
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache