Skip to content

Merge pull request #9 from FoxBukkit/renovate/amazoncorretto-21.x #21

Merge pull request #9 from FoxBukkit/renovate/amazoncorretto-21.x

Merge pull request #9 from FoxBukkit/renovate/amazoncorretto-21.x #21

Workflow file for this run

name: Build Docker image
on: [push]
concurrency:
group: docker-${{ github.ref }}
cancel-in-progress: true
jobs:
docker:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
# Setup Docker
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Setup build cache
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-single-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-single-buildx
- name: Ensure we are up to date on all images
run: docker pull amazoncorretto:21-alpine
- name: Build container image
uses: docker/build-push-action@v5
with:
context: docker
push: true
load: false
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
build-args: |
GIT_REVISION=${{ github.sha }}
tags: |
ghcr.io/foxbukkit/packages/server:latest
# https://github.com/docker/build-push-action/issues/252 (prevent cache from growing indefinitely)
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache