63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- test/**
|
|
tags:
|
|
- "[0-9]+.[0-9]+.[0-9]+"
|
|
paths-ignore:
|
|
- README.md
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
if: github.repository == 'itzg/docker-minecraft-bedrock-server'
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Cache Docker layers
|
|
uses: actions/cache@v3
|
|
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.7.0
|
|
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
|
|
pull: true
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|