cacheport

CI provider

Cacheport with GitHub Actions

GitHub-hosted runners start from a clean machine on every job, which means every dependency is downloaded again unless something keeps it close. Cacheport does, for packages, images and build outputs.

CI · GITHUB-ACTIONSManifest
Config
.github/workflows/*.yml
Token
Repository or organisation secret CACHEPORT_TOKEN
Keyless
OIDC with id-token: write
Runners
GitHub-hosted and self-hosted
Regions
iad1 is closest to most GitHub-hosted runners

Give your pipelines a token

Option 1: a secret

Create a read token in Cacheport and save it as an organisation secret so every repository can use it.

shell
$ cacheport token create github-ci --scope read
$ gh secret set CACHEPORT_TOKEN --org acme-corp --visibility all
Option 2: OIDC, no stored secret

Let the workflow exchange its GitHub identity for a short-lived Cacheport token. Allow your organisation once in the workspace settings.

.github/workflows/ci.yml
permissions:
  id-token: write
  contents: read

steps:
  - uses: cacheport/login@v1
    with:
      workspace: acme
  # exports CACHEPORT_TOKEN for the rest of the job

Examples

Pick an ecosystem. Every example uses the CACHEPORT_TOKEN secret from above.

npm

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          registry-url: https://acme.cacheport.cc/npm/
      - run: npm ci
        env:
          NODE_AUTH_TOKEN: ${{ secrets.CACHEPORT_TOKEN }}
      - run: npm test

Full guide: npm cache.

Yarn

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    env:
      YARN_NPM_REGISTRY_SERVER: https://acme.cacheport.cc/npm/
      YARN_NPM_AUTH_TOKEN: ${{ secrets.CACHEPORT_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: corepack enable
      - run: yarn install --immutable
      - run: yarn test

Full guide: Yarn cache.

pnpm

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    env:
      CACHEPORT_TOKEN: ${{ secrets.CACHEPORT_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: pnpm
      - run: pnpm install --frozen-lockfile
      - run: pnpm test

Full guide: pnpm cache.

pip

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    env:
      PIP_INDEX_URL: https://ci:${{ secrets.CACHEPORT_TOKEN }}@acme.cacheport.cc/pypi/simple/
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.13"
          cache: pip
      - run: pip install -r requirements.txt
      - run: pytest

Full guide: pip cache.

Poetry

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    env:
      POETRY_HTTP_BASIC_CACHEPORT_USERNAME: ci
      POETRY_HTTP_BASIC_CACHEPORT_PASSWORD: ${{ secrets.CACHEPORT_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.13"
      - run: pipx install poetry
      - run: poetry install --no-interaction
      - run: poetry run pytest

Full guide: Poetry cache.

uv

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    env:
      UV_INDEX_CACHEPORT_USERNAME: ci
      UV_INDEX_CACHEPORT_PASSWORD: ${{ secrets.CACHEPORT_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v5
        with:
          enable-cache: true
      - run: uv sync --locked
      - run: uv run pytest

Full guide: uv cache.

Conda

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash -el {0}
    env:
      CONDA_CHANNEL_ALIAS: https://ci:${{ secrets.CACHEPORT_TOKEN }}@acme.cacheport.cc/conda/
    steps:
      - uses: actions/checkout@v4
      - uses: conda-incubator/setup-miniconda@v3
        with:
          environment-file: environment.yml
          channels: conda-forge
      - run: pytest

Full guide: Conda cache.

Maven

.github/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    env:
      CACHEPORT_TOKEN: ${{ secrets.CACHEPORT_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: 21
          cache: maven
      - run: mvn verify

Full guide: Maven cache.

Gradle

.github/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    env:
      CACHEPORT_TOKEN: ${{ secrets.CACHEPORT_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: 21
      - uses: gradle/actions/setup-gradle@v4
      - run: ./gradlew build

Full guide: Gradle cache.

Go modules

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    env:
      GOPROXY: https://acme.cacheport.cc/go,direct
    steps:
      - uses: actions/checkout@v4
      - run: printf "machine acme.cacheport.cc login ci password %s\n" "${{ secrets.CACHEPORT_TOKEN }}" > ~/.netrc
      - uses: actions/setup-go@v5
        with:
          go-version-file: go.mod
      - run: go test ./...

Full guide: Go modules cache.

Cargo

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    env:
      CARGO_REGISTRIES_CACHEPORT_TOKEN: Bearer ${{ secrets.CACHEPORT_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - run: cargo test --locked

Full guide: Cargo cache.

RubyGems

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    env:
      BUNDLE_ACME__CACHEPORT__CC: ci:${{ secrets.CACHEPORT_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - run: bundle config set --global mirror.https://rubygems.org https://acme.cacheport.cc/gems/
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: "3.3"
          bundler-cache: true
      - run: bundle exec rake test

Full guide: RubyGems cache.

Composer

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    env:
      COMPOSER_AUTH: '{"http-basic":{"acme.cacheport.cc":{"username":"ci","password":"${{ secrets.CACHEPORT_TOKEN }}"}}}'
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: "8.3"
      - run: composer install --no-interaction --prefer-dist
      - run: vendor/bin/phpunit

Full guide: Composer cache.

NuGet

.github/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    env:
      CACHEPORT_TOKEN: ${{ secrets.CACHEPORT_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 8.0.x
      - run: dotnet restore --locked-mode
      - run: dotnet test --no-restore

Full guide: NuGet cache.

Docker Hub

.github/workflows/ci.yml
jobs:
  image:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: docker/login-action@v3
        with:
          registry: acme.cacheport.cc
          username: ci
          password: ${{ secrets.CACHEPORT_TOKEN }}
      - uses: docker/build-push-action@v6
        with:
          context: .
          push: false

Full guide: Docker Hub cache.

Helm

.github/workflows/deploy.yml
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: azure/setup-helm@v4
      - run: |
          helm repo add prometheus-community https://acme.cacheport.cc/helm/prometheus-community/ \
            --username ci --password "${{ secrets.CACHEPORT_TOKEN }}"
          helm dependency build charts/app

Full guide: Helm cache.

apt

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Use Cacheport for apt
        run: |
          sudo sed -i "s|http://azure.archive.ubuntu.com|https://acme.cacheport.cc/apt/archive.ubuntu.com|g" /etc/apt/sources.list.d/ubuntu.sources
          printf "machine acme.cacheport.cc login ci password %s\n" "${{ secrets.CACHEPORT_TOKEN }}" | sudo tee /etc/apt/auth.conf.d/cacheport.conf > /dev/null
          sudo apt-get update
      - run: sudo apt-get install -y libpq-dev

Full guide: apt cache.

Alpine apk

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    container: alpine:3.20
    steps:
      - run: sed -i "s|https://dl-cdn.alpinelinux.org|https://acme.cacheport.cc/apk|g" /etc/apk/repositories
      - run: apk add --no-cache make gcc musl-dev
      - uses: actions/checkout@v4
      - run: make test

Full guide: Alpine apk cache.

Combine with actions/cache

The setup-* actions can restore a dependency folder keyed on your lockfile. Keep that: it saves the copy step on a cache hit. When the key misses, which happens on every lockfile change, Cacheport makes the downloads fast and keeps them away from the public registries. See Cache not found for input keys for what a miss means.

Self-hosted runners

Self-hosted runners often share one outbound IP address, which is where public registry rate limits bite. Pick the Cacheport region closest to your runners when you create the workspace; packages then travel a few milliseconds instead of across the internet.

Questions

Do pull requests from forks get the token?

No. GitHub does not pass secrets to workflows triggered by forks. Allow anonymous reads from GitHub's IP ranges for public repositories, or let fork builds use the public registries.

Which region should I pick?

Most GitHub-hosted runners run in US data centres, so iad1 is usually fastest. For self-hosted runners, pick the region closest to them.

Does it work with larger runners and ARM runners?

Yes. Cacheport is just an HTTPS endpoint; any runner that can reach the internet can use it.

Setting up somewhere else too?

Start on the free plan

20 GB of cache, every registry, unlimited users. Upgrade when your pipelines outgrow it.