Files
fex-bedrock-vanilla/.github/workflows/ci.yml
T

67 lines
1.8 KiB
YAML

name: CI
on:
push:
branches:
- master
- test/**
tags:
- "[0-9]+.[0-9]+.[0-9]+"
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'itzg/docker-minecraft-bedrock-server'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Metadata action
id: meta
uses: docker/metadata-action@v3.6.2
with:
images: itzg/minecraft-bedrock-server
flavor: |
latest=${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: |
${{ steps.meta.outputs.labels }}
manymine.enable=true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache