Repository navigation
CI configuration reference
The behaviour of the CI is configured in .github/ci.yaml. This page is the complete reference of that file. For guided examples, see Publishing to registries and Ubuntu Pro rocks.
The file is validated at the start of every run. Unknown keys are rejected, so a typo fails the run instead of being silently ignored.
Note
This reference describes canonical/rocks-actions v1.4.1, the version pinned by the template. Information on how to update from an older version can be found in Maintaining your repository.
The template ships with:
version: 1
ghcr:
upload: true
cve-scan: true
registries:
# (commented-out examples)
images:
- directory: "."| Key | Required | Type | Description |
|---|---|---|---|
version |
Yes | int | Version of the configuration format. Must be 1. |
ghcr |
Yes | object | Publishing to the GitHub Container Registry and scanning. |
registries |
Yes | map | Additional registries that images can be published to. May be empty. |
images |
Yes | list | The rocks to build, test and upload. |
| Key | Required | Type | Description |
|---|---|---|---|
ghcr.upload |
Yes | bool | Upload images to ghcr.io/<owner>/<repository> after a successful build and test on main. |
ghcr.cve-scan |
Yes | bool | Enable the scheduled vulnerability scan of the images published to GHCR. Can only be true if ghcr.upload is also true. |
A map of named additional registries. A registry only receives images that reference its name in images[].registries. The map may be empty (registries: with no entries), but the key must be present.
registries:
<name>:
uri: <registry URI>
auth:
- method: <method>
config:
<method-specific parameters>| Key | Required | Type | Description |
|---|---|---|---|
registries.<name> |
No | object | A registry. <name> is how images refer to it. |
registries.<name>.uri |
Yes | string | The registry URI including any namespace, for example docker.io/ubuntu. Images are published to <uri>/<rock-name>:<tag>. |
registries.<name>.auth |
Yes | list | The authentication configuration. It must contain exactly one entry. |
registries.<name>.auth[0].method |
Yes | string | One of basic, ecr, ecr-public. |
registries.<name>.auth[0].config |
Yes | object | Parameters of the method. See authentication methods for information on what to include here. |
All credentials are given as references to repository secrets, written as secrets.<SECRET_NAME>. Never put actual credentials in ci.yaml. See Secrets and permissions for more information on referencing secrets in ci.yaml.
| Method | Parameters | Description |
|---|---|---|
basic |
username: secretpassword: secret |
Username and password authentication. |
ecr |
region: stringusername: secretpassword: secret |
AWS ECR (private registries). username is the AWS access key ID and password the AWS secret access key. |
ecr-public |
region: stringusername: secretpassword: secret |
AWS ECR Public. Same parameters as ecr. |
A list of the rocks to process. Each item describes one rock directory.
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
directory |
No | string | repository root | Directory containing the rockcraft.yaml. "." (or omitting the key) means the repository root. The single value "*" matches every directory in the repository that contains a rockcraft.yaml. |
registries |
No | list[string] | [] |
Names of the additional registries to publish this rock to, in addition to GHCR (if enabled). Every name must be defined in registries. |
pro |
No | object | none | Build the rock with Ubuntu Pro services. |
lfs |
No | bool | false |
Intended to download Git LFS files of the repository during the build. See the warning below. |
lfs-include |
No | string | all files | Intended as the --include pattern for git lfs pull. See the warning below. |
Behavior worth knowing:
-
Skipped directories: if the directory has no
rockcraft.yaml, the image is skipped with a warning. This lets the template work before you add your first rock. -
Wildcard:
"*"must be the only character in the value ("my-rocks/*"is rejected). Theregistries,pro,lfsandlfs-includesettings of the entry apply to every directory it matches. Use explicit entries if rocks need different settings. - Duplicates: entries for the same directory with the same Pro services are merged, and their registries are combined.
-
Same directory, several variants: entries for the same directory with different Pro services produce separate builds, for example one plain and one
esm-appsvariant. See the note on tags. - Artifact names must be unique across all entries.
Settings for building a rock with Ubuntu Pro services.
| Key | Required | Type | Description |
|---|---|---|---|
pro.services |
Yes | list[string] | Pro services to enable during the build. Allowed values: esm-apps, esm-infra, fips-updates, fips, fips-preview, ros, ros-updates. |
pro.config.token |
Yes | secret | The secret holding the Ubuntu Pro token: secrets.<SECRET_NAME>. |
pro.config.artifact-passphrase |
Yes | secret | The secret holding the passphrase used to encrypt the Pro build artifacts: secrets.<SECRET_NAME>. |
This configuration:
- builds every rock in the repository,
- uploads them to GHCR and enables the daily vulnerability scan,
- builds them with the
esm-appsPro service, - additionally publishes them to a private registry with basic authentication.
version: 1
ghcr:
upload: true
cve-scan: true
registries:
my-private-registry:
uri: my.private.registry.com
auth:
- method: basic
config:
username: secrets.MY_PRIVATE_REGISTRY_USERNAME
password: secrets.MY_PRIVATE_REGISTRY_PASSWORD
images:
- directory: "*"
pro:
services:
- esm-apps
config:
token: secrets.MY_PRO_TOKEN
artifact-passphrase: secrets.MY_CUSTOM_PASSPHRASE
registries:
- my-private-registryImportant
Pro-enabled rocks are not uploaded to GHCR from public repositories. See Ubuntu Pro Rocks for more information on this.
version: 1
ghcr:
upload: true
cve-scan: true
registries:
docker.io:
uri: docker.io/my-namespace
auth:
- method: basic
config:
username: secrets.DOCKERHUB_USERNAME
password: secrets.DOCKERHUB_TOKEN
images:
- directory: "my-rock/0.1-24.04"
registries:
- docker.io
- directory: "other-rock/1.0-22.04" # GHCR onlyversion: 1
ghcr:
upload: false
cve-scan: false
registries: {}
images:
- directory: "."| Rule | Error |
|---|---|
version must be 1. |
Only version 1 of the CI configuration is supported. |
ghcr.cve-scan: true requires ghcr.upload: true. |
cve-scan can not be true if upload is false |
auth must be a list with exactly one entry. |
Auth list must contain exactly one entry. |
method must be a supported method. |
Invalid auth method '...' |
Credentials must start with secrets.. |
Credential name must start with 'secrets.' |
Registries in images[].registries must exist. |
Registry '...' in image '...' is not defined in registries. |
"*" must be the only character of directory. |
Wildcard '*' must be the only character in directory |
pro.services must be known Pro services. |
Invalid Ubuntu Pro service '...' |
| Unknown keys are rejected. | Extra inputs are not permitted |