From d858c3736a21676d0b67ba89c0c5cae9a553fe72 Mon Sep 17 00:00:00 2001 From: gibsondan Date: Fri, 15 Mar 2024 14:17:00 -0500 Subject: [PATCH] Allow customizing the buildx version used by the deploys that use buildx Summary: A user has reported that they are getting strange cache related errors since buildkit upgraded to v0.13.0. Give users the ability to customize which buildx version is being used. Test Plan: Test a serverless deploy with the new input set and not set --- actions/hybrid_branch_deploy/action.yml | 6 ++++++ actions/hybrid_prod_deploy/action.yml | 5 +++++ actions/serverless_branch_deploy/action.yml | 8 +++++++- actions/serverless_prod_deploy/action.yml | 5 +++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/actions/hybrid_branch_deploy/action.yml b/actions/hybrid_branch_deploy/action.yml index 18c4c95a..d6087edc 100644 --- a/actions/hybrid_branch_deploy/action.yml +++ b/actions/hybrid_branch_deploy/action.yml @@ -14,6 +14,10 @@ inputs: required: false description: "Whether to start the action by checking out the repository. Set to false if your workflow modifies the file structure before deploying." default: 'true' + buildx_version: + required: false + description: "Which version of buildx to use to build and deploy the Docker image." + outputs: deployment: description: "Name of the branch deployment for this PR" @@ -56,6 +60,8 @@ runs: - name: Set up Docker Buildx if: ${{ github.event.pull_request.state != 'closed' }} uses: docker/setup-buildx-action@v2 + with: + ${{ inputs.buildx_version != '' && (version: ' + inputs.buildx_version || '' }} # See https://github.com/docker/build-push-action/ for more info - name: Build and push Docker image diff --git a/actions/hybrid_prod_deploy/action.yml b/actions/hybrid_prod_deploy/action.yml index 67ba0ab4..91416ba8 100644 --- a/actions/hybrid_prod_deploy/action.yml +++ b/actions/hybrid_prod_deploy/action.yml @@ -19,6 +19,9 @@ inputs: required: false description: "Whether to start the action by checking out the repository. Set to false if your workflow modifies the file structure before deploying." default: 'true' + buildx_version: + required: false + description: "Which version of buildx to use to build and deploy the Docker image." runs: using: "composite" @@ -45,6 +48,8 @@ runs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + with: + ${{ inputs.buildx_version != '' && (version: ' + inputs.buildx_version || '' }} - name: Build and push Docker image uses: docker/build-push-action@v4 diff --git a/actions/serverless_branch_deploy/action.yml b/actions/serverless_branch_deploy/action.yml index 61844727..dd64d4a9 100644 --- a/actions/serverless_branch_deploy/action.yml +++ b/actions/serverless_branch_deploy/action.yml @@ -20,11 +20,15 @@ inputs: required: false description: "Whether to start the action by checking out the repository. Set to false if your workflow modifies the file structure before deploying." default: 'true' + buildx_version: + required: false + description: "Which version of buildx to use to build and deploy the Docker image." + outputs: deployment: description: "Name of the branch deployment for this PR" value: ${{ steps.deploy.outputs.deployment }} - + runs: using: "composite" steps: @@ -73,6 +77,8 @@ runs: - name: Set up Docker Buildx if: ${{ github.event.pull_request.state != 'closed' }} uses: docker/setup-buildx-action@v2 + with: + ${{ inputs.buildx_version != '' && (version: ' + inputs.buildx_version || '' }} - name: Copy user code template file if: ${{ github.event.pull_request.state != 'closed' }} diff --git a/actions/serverless_prod_deploy/action.yml b/actions/serverless_prod_deploy/action.yml index 910dbe30..f6fe1e07 100644 --- a/actions/serverless_prod_deploy/action.yml +++ b/actions/serverless_prod_deploy/action.yml @@ -24,6 +24,9 @@ inputs: required: false description: "Whether to start the action by checking out the repository. Set to false if your workflow modifies the file structure before deploying." default: 'true' + buildx_version: + required: false + description: "Which version of buildx to use to build and deploy the Docker image." runs: using: "composite" @@ -62,6 +65,8 @@ runs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + with: + ${{ inputs.buildx_version != '' && (version: ' + inputs.buildx_version || '' }} - name: Copy user code template file uses: ./action-repo/actions/utils/copy_template