GitHub Packages Docker Registry

To give FeaturePeek the credentials to pull images from GitHub Packages, you need to ensure that one environment variable is present in your CI environment.

Note: This chapter is only applicable if you push images to GitHub Packages.

CI command

You'll need to pass in the -p flag when pinging FeaturePeek in your CI pipeline.

bash <(curl -s https://peek.run/ci) -p docker.pkg.github.com/myorg/myrepo/myimage:mytag

Be sure to call this after your build step.

Required environment variables

GITHUB_TOKEN

If you are using a GitHub Actions workflow, the GITHUB_TOKEN secret gets generated for you on every CI run automatically. Simply point an environment variable of the same name to this secret in the Ping FeaturePeek step.

Below is an example workflow YAML file that builds a docker image and pushes it to the GitHub Packages registry. Be sure to replace ORG, REPO, IMAGE, and TAG with your own values.

The last line in the following example is how you set an environment variable to a secret.

# /.github/workflows/main.yml
name: Build and ping FeaturePeek
on: push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Docker login
run: docker login -u ORG -p ${{ secrets.GITHUB_TOKEN }} docker.pkg.github.com
- name: Build and push image
run: |
docker build -t docker.pkg.github.com/ORG/REPO/IMAGE:TAG .
docker push docker.pkg.github.com/ORG/REPO/IMAGE:TAG
- name: Ping FeaturePeek
run: bash <(curl -s https://peek.run/ci) -p docker.pkg.github.com/ORG/REPO/IMAGE:TAG
env:
CI: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

You can also use a Personal Access Token instead of a secret — just replace ${{ secrets.GITHUB_TOKEN }} with your token value in both the Docker login and Ping FeaturePeek steps. Be sure to grant the token both read:packages and write:packages scopes when you create it.