You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Use Depot
v1.0.1
This action prepares the environment to build Docker images with the Depot CLI. It does this by making the following changes:
- Installs the
depot
CLI in the GitHub Actions environment. - Installs Depot as a Docker CLI plugin (
docker depot ...
) - Sets the Depot plugin as the default Docker builder (
docker build ...
) - Installs a Buildx shim so that
docker buildx build
is forwarded to the Depot plugin.
Download and use the latest version of the CLI:
jobs:
job-name:
steps:
- uses: depot/use-action@v1
- run: depot ...
The depot
CLI needs to resolve a project ID to build images. This can be from a DEPOT_PROJECT_ID
environment variable, a depot.json
file, or the --project
CLI flag. To set the global DEPOT_PROJECT_ID
, use the project
input:
jobs:
job-name:
steps:
- uses: depot/use-action@v1
with:
project: abc123xzy
The depot
CLI also needs to authenticate with Depot to connect to remote builders. We recommend using OIDC trust relationships to authenticate, as these do not require configuring a static access token:
jobs:
job-name:
permissions:
contents: read
id-token: write
# optional, if you need to push to ghcr.io
packages: write
steps:
- uses: depot/use-action@v1
If you do need to provide an API token, you can set the DEPOT_TOKEN
environment variable with the token
input:
jobs:
job-name:
steps:
- uses: depot/use-action@v1
with:
token: ${{ secrets.DEPOT_TOKEN }}
project
(optional) - A string representing the project ID to use for builds. This can be overridden by theDEPOT_PROJECT_ID
environment variable or the--project
CLI flag.token
(optional) - A string representing the API token to use for authentication. This can be overridden by theDEPOT_TOKEN
environment variable.version
(optional) - A string representing the version of the Depot CLI to install (e.g.1.2.3
). The default value islatest
which will install the latest available version. Can also specify a semver version range selector (e.g.0.x.x
).shim-buildx
(optional) - A boolean representing whether to install the Buildx shim. The default value istrue
.
MIT License, see LICENSE
.