Skip to content

Commit

Permalink
[FX-NULL] Add gh-runners-driver-opts option (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
catks authored Nov 6, 2024
1 parent aeebdae commit 5f88bee
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/long-poems-work.md
Original file line number Diff line number Diff line change
@@ -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`
33 changes: 17 additions & 16 deletions build-push-image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<<br/>`temploy`,<br/>`staging`,<br/>`production`,<br/>> | | 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<<br/>`temploy`,<br/>`staging`,<br/>`production`,<br/>> | | 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

Expand Down
5 changes: 5 additions & 0 deletions build-push-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5f88bee

Please sign in to comment.