This action prepares the environment to build Docker images with the Depot CLI. It does this by making the following changes:
- Installs the
depotCLI 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 driver so that
docker buildx buildis 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: abc123xzyThe 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@v1If 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_IDenvironment variable or the--projectCLI flag.token(optional) - A string representing the API token to use for authentication. This can be overridden by theDEPOT_TOKENenvironment variable.version(optional) - A string representing the version of the Depot CLI to install (e.g.1.2.3). The default value islatestwhich will install the latest available version. Can also specify a semver version range selector (e.g.0.x.x).
MIT License, see LICENSE.