This tutorial shows you how to automatically publish Python, Docker, and NPM packages to RepoForge.io using the official GitHub Action.

Step 1: Create a GitHub repository

You can refer to the example here to see a valid repository setup that works with the options described below.

Step 2: Get Your RepoForge.io Credentials

Log into your RepoForge.io account and:

Find your Hash ID on your account dashboard. (You will use this in package URLs.)

Create an access token in the RepoForge dashboard under Access Tokens, ensuring it has write permissions enabled for the package types you plan to publish (Python, Docker, or NPM).

Step 3: Store Credentials Securely in GitHub

In your GitHub repository, navigate to Settings → Secrets and variables → Actions and create these secrets:

  • REPOFORGE_TOKEN: Your RepoForge.io access token
  • REPOFORGE_HASH_ID: Your RepoForge.io hash ID

Step 4: Create Your GitHub Actions Workflow

Create a new file .github/workflows/publish.yml in your repository and insert the following content:

name: Publish Python Package to RepoForge

on:
  push:
    branches: [ main ]

jobs:
  publish-python:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.13'
      - name: Install build tools
        run: pip install build
      - name: Build package
        run: python -m build
      - name: Publish to RepoForge
        uses: RepoForge-io/repoforge-publish-action@main
        with:
          api_token: ${{ secrets.REPOFORGE_TOKEN }}
          hash_id: ${{ secrets.REPOFORGE_HASH_ID }}

  publish-docker:
    runs-on: ubuntu-latest
    name: Build and push Docker image
    steps:
      - name: Checkout repo
        uses: actions/checkout@v4
      - name: Publish Docker image to RepoForge
        uses: RepoForge-io/repoforge-publish-action@main
        with:
          package_type: docker
          api_token: ${{ secrets.REPOFORGE_TOKEN }}
          hash_id: ${{ secrets.REPOFORGE_HASH_ID }}
          registry_name: my-registry
          docker_context: docker


  publish-npm:
    runs-on: ubuntu-latest
    name: Publish NPM package
    steps:
      - name: Checkout repo
        uses: actions/checkout@v4
      - name: Publish NPM package
        uses: RepoForge-io/repoforge-publish-action@main
        with:
          package_type: npm
          api_token: ${{ secrets.REPOFORGE_TOKEN }}
          hash_id: ${{ secrets.REPOFORGE_HASH_ID }}
          package_dir: npm

Step 5: Push your code and watch the pipeline run

Once you’ve configured your actions correctly, just commit and push the code to your repository. You should see three green blobs if everything works correctly:

Step 6: Check the outputs in your RepoForge.io dashboard

If your Github Actions passed successfully, you should be able to see your published artifacts in RepoForge.io:

Coming Soon: Conda and Debian

The GitHub Action will soon support Conda and Debian packages, enabling even broader integration for your CI/CD workflows.

Conclusion

Automating package publishing saves you valuable time, streamlines deployments, and reduces errors. With RepoForge.io’s official GitHub Action, integration is simple and effective, giving your team more space to focus on building great software.