Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,13 @@ jobs:
# Pin version for Java 8, also be sure to set in verify-pr.yml
mcHelperVersion: 1.51.3-java8
env:
# Assume they line up, but when forked change to your Docker Hub username
DOCKER_HUB_ORG: ${{ github.repository_owner }}
IMAGE_TO_TEST: "${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}"
HAS_IMAGE_REPO_ACCESS: ${{ secrets.DOCKER_USER != '' && secrets.DOCKER_PASSWORD != '' }}
MAIN_VARIANT: java25
PUSH: ${{ github.repository_owner == 'itzg' }}
IMAGE_AUTHOR: "Geoff Bourne <itzgeoff@gmail.com>"
runs-on: ubuntu-22.04
steps:
- name: Checkout
Expand All @@ -117,10 +121,8 @@ jobs:
id: meta
uses: docker/metadata-action@v6.2.0
with:
# NOTE for forks: if your Docker Hub organization doesn't match your Github repo's,
# then the use of ${{ github.repository_owner }} will need to be replaced.
images: |
${{ github.repository_owner }}/minecraft-server
${{ env.DOCKER_HUB_ORG }}/minecraft-server
ghcr.io/${{ github.repository_owner }}/minecraft-server
tags: |
# Apply the variant as a moving tag for most recent commit per variant
Expand All @@ -142,7 +144,7 @@ jobs:
flavor: |
latest=${{ matrix.variant == env.MAIN_VARIANT && github.ref_name == github.event.repository.default_branch }}
labels: |
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
org.opencontainers.image.authors=${{ env.IMAGE_AUTHOR }}

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v4
Expand Down Expand Up @@ -198,13 +200,16 @@ jobs:
platforms: ${{ matrix.platforms }}
push: >
${{
github.ref_type == 'tag'
|| github.ref_name == github.event.repository.default_branch
|| startsWith(github.ref_name, 'test/')
|| ( github.event_name == 'pull_request'
&& env.HAS_IMAGE_REPO_ACCESS
&& contains(github.event.pull_request.labels.*.name, 'ci/push-image')
)
env.PUSH &&
(
github.ref_type == 'tag'
|| github.ref_name == github.event.repository.default_branch
|| startsWith(github.ref_name, 'test/')
|| ( github.event_name == 'pull_request'
&& env.HAS_IMAGE_REPO_ACCESS
&& contains(github.event.pull_request.labels.*.name, 'ci/push-image')
)
)
}}
tags: ${{ steps.meta.outputs.tags }}
# ensure latest base image is used
Expand All @@ -221,5 +226,6 @@ jobs:
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
${{ matrix.mcHelperVersion && format('MC_HELPER_VERSION={0}', matrix.mcHelperVersion) }}
${{ matrix.knockdRepoOrg && format('KNOCKD_REPO_ORG={0}', matrix.knockdRepoOrg) }}
IMAGE_AUTHOR=${{ env.IMAGE_AUTHOR }}
cache-from: type=gha,scope=${{ matrix.variant }}
cache-to: type=gha,mode=max,scope=${{ matrix.variant }}
1 change: 1 addition & 0 deletions .github/workflows/discord.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
discord:
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.repository_owner == 'itzg'
steps:
- name: on-publish
if: github.event_name == 'release' && github.event.action == 'published'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- labeled
jobs:
notify:
if: github.repository_owner == 'itzg'
uses: itzg/github-workflows/.github/workflows/issues-notify-discord.yml@main
with:
triageLabel: 'status/needs triage'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/stale-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
jobs:
check:
runs-on: ubuntu-22.04
if: github.repository_owner == 'itzg'
permissions:
issues: write
pull-requests: write
Expand Down