From 5f88bee8653c2774690d6e7b0e3877786ec84c2d Mon Sep 17 00:00:00 2001 From: Carlos Atkinson Date: Wed, 6 Nov 2024 09:51:02 -0300 Subject: [PATCH] [FX-NULL] Add gh-runners-driver-opts option (#356) --- .changeset/long-poems-work.md | 5 +++++ build-push-image/README.md | 33 +++++++++++++++++---------------- build-push-image/action.yml | 5 +++++ 3 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 .changeset/long-poems-work.md diff --git a/.changeset/long-poems-work.md b/.changeset/long-poems-work.md new file mode 100644 index 00000000..0a2edb2b --- /dev/null +++ b/.changeset/long-poems-work.md @@ -0,0 +1,5 @@ +--- +'davinci-github-actions': minor +--- + +- add `gh-runners-driver-opts` option to `build-push-image` action to allow using custom image for `buildx` diff --git a/build-push-image/README.md b/build-push-image/README.md index df41f5ca..b9d30b80 100644 --- a/build-push-image/README.md +++ b/build-push-image/README.md @@ -12,22 +12,23 @@ This GH Action builds a Docker image and pushes to google cloud. The list of arguments, that are used in GH Action: -| name | type | required | default | description | -| ------------------ | ----------------------------------------------------------- | -------- | ----------------- | ------------------------------------------------------------------------------------------ | -| `sha` | string | | ${{ github.sha }} | Commit hash that will be used as a tag for the Docker image | -| `image-name` | string | ✅ | | Name of the Docker image. Might be used in the next steps (for ex.: deploy a Docker image) | -| `build-args` | string | | | Multiline string to describe build arguments that will be used during dockerization | -| `environment` | enum<
`temploy`,
`staging`,
`production`,
> | | staging | Determines additional procedures while creating a Docker image. | -| `docker-file` | string | | Dockerfile | pathname to Dockerfile | -| `davinci-branch` | string | | master | Custom davinci branch | -| `labels` | string | | | List of metadata for the Docker image | -| `context` | string | | . | Build context | -| `push` | string | | true | Push the image to the registry | -| `platforms` | string | | linux/amd64 | List of target platforms for build | -| `tags` | string | | | Additional tags for the Docker image | -| `target` | string | | | Sets the target stage to build | -| `checkout-davinci` | string | | false | Checkout davinci repository | -| `registry-name` | string | ✅ | | Registry to push the builded image | +| name | type | required | default | description | +| ----------------------- | ----------------------------------------------------------- | -------- | ----------------- | ------------------------------------------------------------------------------------------ | +| `sha` | string | | ${{ github.sha }} | Commit hash that will be used as a tag for the Docker image | +| `image-name` | string | ✅ | | Name of the Docker image. Might be used in the next steps (for ex.: deploy a Docker image) | +| `build-args` | string | | | Multiline string to describe build arguments that will be used during dockerization | +| `environment` | enum<
`temploy`,
`staging`,
`production`,
> | | staging | Determines additional procedures while creating a Docker image. | +| `docker-file` | string | | Dockerfile | pathname to Dockerfile | +| `davinci-branch` | string | | master | Custom davinci branch | +| `labels` | string | | | List of metadata for the Docker image | +| `context` | string | | . | Build context | +| `push` | string | | true | Push the image to the registry | +| `platforms` | string | | linux/amd64 | List of target platforms for build | +| `tags` | string | | | Additional tags for the Docker image | +| `target` | string | | | Sets the target stage to build | +| `checkout-davinci` | string | | false | Checkout davinci repository | +| `registry-name` | string | ✅ | | Registry to push the builded image | +| `gh-runner-driver-opts` | string | | | Driver options for GH Runners | ### Outputs diff --git a/build-push-image/action.yml b/build-push-image/action.yml index d72aee74..0e8f9dd8 100644 --- a/build-push-image/action.yml +++ b/build-push-image/action.yml @@ -61,6 +61,9 @@ inputs: registry-name: required: true description: 'Registry to push the builded image' + gh-runner-driver-opts: + required: false + description: 'Driver options for GH Runners' runs: using: composite @@ -123,6 +126,8 @@ runs: - name: Set up Docker Buildx - GH runners if: "!(contains(runner.name, 'inf-gha-runners') && contains(runner.name, 'ubuntu2204'))" uses: docker/setup-buildx-action@v3 + with: + driver-opts: ${{ inputs.gh-runner-driver-opts }} - name: Build and push release image uses: docker/build-push-action@v5