diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index dd051ed6a3..0068514cae 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -37,6 +37,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract version from release tag or input id: version run: | @@ -59,6 +66,8 @@ jobs: tags: | ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }} ${{ env.IMAGE_NAME }}:latest + ghcr.io/diegosouzapw/omniroute:${{ steps.version.outputs.version }} + ghcr.io/diegosouzapw/omniroute:latest cache-from: type=gha cache-to: type=gha,mode=max no-cache: false diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 4b03595de6..c60cafad4a 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -105,3 +105,21 @@ jobs: echo "✅ Published omniroute@$VERSION (tag: $TAG)" env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish to GitHub Packages + run: | + VERSION="${{ steps.resolve.outputs.version }}" + TAG="${{ steps.resolve.outputs.tag }}" + + echo "Configuring for GitHub Packages..." + echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc + npm pkg set name="@diegosouzapw/omniroute" + + if [ "$TAG" = "latest" ]; then + npm publish --registry=https://npm.pkg.github.com || echo "⚠️ Version ${VERSION} might already be published on GitHub." + else + npm publish --registry=https://npm.pkg.github.com --tag "$TAG" || echo "⚠️ Version ${VERSION} might already be published on GitHub." + fi + echo "✅ Action finished for GitHub Packages" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}