Skip to content

Commit 851fc95

Browse files
authored
Publish image to GHCR also (#582)
1 parent 974fcb9 commit 851fc95

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
build:
2424
runs-on: ubuntu-latest
2525
if: github.repository == 'itzg/docker-minecraft-bedrock-server'
26+
env:
27+
IMAGE_BASE_NAME: minecraft-bedrock-server
2628

2729
steps:
2830
- name: Set up QEMU
@@ -38,11 +40,21 @@ jobs:
3840
username: ${{ secrets.DOCKER_USER }}
3941
password: ${{ secrets.DOCKER_PASSWORD }}
4042

43+
- name: Login to GHCR
44+
if: github.event_name != 'pull_request'
45+
uses: docker/login-action@v3.6.0
46+
with:
47+
registry: ghcr.io
48+
username: ${{ github.actor }}
49+
password: ${{ github.token }}
50+
4151
- name: Docker Metadata action
4252
id: meta
4353
uses: docker/metadata-action@v4
4454
with:
45-
images: itzg/minecraft-bedrock-server
55+
images: |
56+
${{ github.repository_owner }}/${{ env.IMAGE_BASE_NAME }}
57+
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_BASE_NAME }}
4658
flavor: |
4759
latest=${{ github.event_name == 'push' && github.ref_name == 'master' }}
4860

0 commit comments

Comments
 (0)