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.
- 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
Create a read token in Cacheport and save it as an organisation secret so every repository can use it.
$ cacheport token create github-ci --scope read
$ gh secret set CACHEPORT_TOKEN --org acme-corp --visibility allLet the workflow exchange its GitHub identity for a short-lived Cacheport token. Allow your organisation once in the workspace settings.
permissions:
id-token: write
contents: read
steps:
- uses: cacheport/login@v1
with:
workspace: acme
# exports CACHEPORT_TOKEN for the rest of the jobExamples
Pick an ecosystem. Every example uses the CACHEPORT_TOKEN secret from above.
npm
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 testFull guide: npm cache.
Yarn
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 testFull guide: Yarn cache.
pnpm
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 testFull guide: pnpm cache.
pip
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: pytestFull guide: pip cache.
Poetry
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 pytestFull guide: Poetry cache.
uv
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 pytestFull guide: uv cache.
Conda
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: pytestFull guide: Conda cache.
Maven
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 verifyFull guide: Maven cache.
Gradle
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 buildFull guide: Gradle cache.
Go modules
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
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 --lockedFull guide: Cargo cache.
RubyGems
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 testFull guide: RubyGems cache.
Composer
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/phpunitFull guide: Composer cache.
NuGet
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-restoreFull guide: NuGet cache.
Docker Hub
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: falseFull guide: Docker Hub cache.
Helm
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/appFull guide: Helm cache.
apt
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-devFull guide: apt cache.
Alpine apk
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 testFull 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.
FAQ
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.
Other CI providers
Setting up somewhere else too?
Start on the free plan
20 GB of cache, every registry, unlimited users. Upgrade when your pipelines outgrow it.