Apply fork-friendly workflow changes from docker-mc-proxy#361 (#664)
- Use github.repository_owner instead of hardcoded 'itzg' for Docker Hub org - Add PUSH environment variable to control when images are pushed (only on itzg repo) - Update login conditions to only run on original repo (env.PUSH) - Add repository_owner check to issues-notify workflow These changes allow workflows to work correctly when the repository is forked. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
bb6212aa58
commit
5275a0517e
5 files changed
+22
-5
No files matched your search
@@ -6,7 +6,8 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
auto-release:
|
auto-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.repository == 'itzg/docker-minecraft-bedrock-server'
|
# If forked, changed to your username to enable auto-releases
|
||||||
|
if: github.repository_owner == 'itzg'
|
||||||
permissions:
|
permissions:
|
||||||
# allow for creating releases/tags
|
# allow for creating releases/tags
|
||||||
contents: write
|
contents: write
|
||||||
|
|||||||
@@ -24,9 +24,11 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.repository == 'itzg/docker-minecraft-bedrock-server'
|
|
||||||
env:
|
env:
|
||||||
IMAGE_BASE_NAME: minecraft-bedrock-server
|
IMAGE_BASE_NAME: minecraft-bedrock-server
|
||||||
|
# Assume they line up, but when forked change to your Docker Hub username
|
||||||
|
DOCKER_HUB_ORG: ${{ github.repository_owner }}
|
||||||
|
PUSH: ${{ github.repository_owner == 'itzg' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
@@ -36,14 +38,14 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
if: github.event_name != 'pull_request'
|
if: env.PUSH && github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Login to GHCR
|
- name: Login to GHCR
|
||||||
if: github.event_name != 'pull_request'
|
if: env.PUSH && github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v3.6.0
|
uses: docker/login-action@v3.6.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@@ -69,7 +71,7 @@ jobs:
|
|||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ env.PUSH && github.event_name != 'pull_request' }}
|
||||||
provenance: false
|
provenance: false
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
notify:
|
notify:
|
||||||
|
if: github.repository_owner == 'itzg'
|
||||||
uses: itzg/github-workflows/.github/workflows/issues-notify-discord.yml@main
|
uses: itzg/github-workflows/.github/workflows/issues-notify-discord.yml@main
|
||||||
secrets:
|
secrets:
|
||||||
discordWebhook: "${{secrets.DISCORD_ISSUES_WEBHOOK}}"
|
discordWebhook: "${{secrets.DISCORD_ISSUES_WEBHOOK}}"
|
||||||
Whitespace-only changes.
@@ -0,0 +1,13 @@
|
|||||||
|
services:
|
||||||
|
bds1:
|
||||||
|
image: itzg/minecraft-bedrock-server
|
||||||
|
environment:
|
||||||
|
EULA: true
|
||||||
|
ports:
|
||||||
|
- "19111:19132/udp"
|
||||||
|
bds2:
|
||||||
|
image: itzg/minecraft-bedrock-server
|
||||||
|
environment:
|
||||||
|
EULA: true
|
||||||
|
ports:
|
||||||
|
- "19222:19132/udp"
|
||||||
Reference in new issue
Block a user