Skip to content

refactor: PlayerQuitEvent #1904

refactor: PlayerQuitEvent

refactor: PlayerQuitEvent #1904

Workflow file for this run

name: Docker
on:
schedule:
- cron: '0 0 * * *'
push:
branches:
- main
tags:
- '*'
permissions: read-all
jobs:
build_and_publish:
name: Build and Publish Docker Image
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
fail-fast: false
matrix:
registry: [ ghcr, dockerhub ]
include:
- registry: ghcr
image: 'ghcr.io/endstonemc/endstone'
- registry: dockerhub
image: 'endstone/endstone'
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: matrix.registry == 'dockerhub'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: matrix.registry == 'ghcr'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
tags: |
type=raw,value=latest,enable={{ is_default_branch }}
type=pep440,pattern={{version}}
- name: Build and Push
uses: docker/build-push-action@v6
if: >
matrix.registry == 'dockerhub' && startsWith(github.ref, 'refs/tags/') ||
matrix.registry == 'ghcr'
with:
context: .
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
secrets: |
sentry-auth-token=${{ secrets.SENTRY_AUTH_TOKEN }}