mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-17 15:43:06 +00:00
83 lines
2.3 KiB
YAML
83 lines
2.3 KiB
YAML
name: Build and publish multiarch
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- "*-multiarch"
|
|
- "multiarch*"
|
|
- java8-openj9
|
|
- java11*
|
|
- java16*
|
|
- test/multiarch/*
|
|
tags:
|
|
- "[0-9]+.[0-9]+.[0-9]+"
|
|
- "[0-9]+.[0-9]+.[0-9]+-multiarch*"
|
|
- "[0-9]+.[0-9]+.[0-9]+-*multiarch"
|
|
- "[0-9]+.[0-9]+.[0-9]+-java8-openj9"
|
|
- "[0-9]+.[0-9]+.[0-9]+-java11*"
|
|
- "[0-9]+.[0-9]+.[0-9]+-java16*"
|
|
paths-ignore:
|
|
- "*.md"
|
|
- "docs/**"
|
|
- "examples/**"
|
|
|
|
jobs:
|
|
docker-buildx:
|
|
if: github.repository == 'itzg/docker-minecraft-server'
|
|
runs-on: ubuntu-20.04
|
|
env:
|
|
CACHE_NAME: java11
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2.3.4
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
images: |
|
|
itzg/minecraft-server
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=tag
|
|
type=edge,branch=master
|
|
flavor: |
|
|
latest=false
|
|
|
|
- name: Setup Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Cache Docker layers
|
|
uses: actions/cache@v2.1.6
|
|
with:
|
|
path: /tmp/.buildx-cache
|
|
key: ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-
|
|
${{ runner.os }}-buildx-
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1.2.0
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and push
|
|
id: docker_build
|
|
uses: docker/build-push-action@v2.5.0
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
# ensure latest base image is used
|
|
pull: true
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|