diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3506c1..811d80e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,16 +30,27 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub + if: endsWith(github.repository, 'mcphub') uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Login to GitHub Container Registry + if: endsWith(github.repository, 'mcphubx') + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker metadata id: meta uses: docker/metadata-action@v5 with: - images: ${{ github.repository }} + images: | + ${{ endsWith(github.repository, 'mcphub') && github.repository || '' }} + ${{ endsWith(github.repository, 'mcphubx') && format('ghcr.io/{0}', github.repository) || '' }} tags: | type=raw,value=edge${{ matrix.variant == 'full' && '-full' || '' }},enable=${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} type=semver,pattern={{version}}${{ matrix.variant == 'full' && '-full' || '' }},enable=${{ startsWith(github.ref, 'refs/tags/') }} @@ -48,6 +59,7 @@ jobs: latest=false - name: Build and Push Docker Image + if: endsWith(github.repository, 'mcphub') || endsWith(github.repository, 'mcphubx') uses: docker/build-push-action@v5 with: context: . diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index e53caba..cef701b 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -7,6 +7,7 @@ on: jobs: publish-npm: runs-on: ubuntu-latest + if: endsWith(github.repository, 'mcphub') steps: - name: Checkout uses: actions/checkout@v4