diff --git a/.github/workflows/reuse-build-and-push-image.yml b/.github/workflows/reuse-build-and-push-image.yml index 4a0fa408b..8fde45af2 100644 --- a/.github/workflows/reuse-build-and-push-image.yml +++ b/.github/workflows/reuse-build-and-push-image.yml @@ -48,7 +48,12 @@ on: description: 'The terraform output which is used to get the ECS_Service and Task Defintion arns for codedeploy' required: false type: string - + archive-download-name: + description: 'If specified, download this archive instead of checkout' + required: false + type: string + default: '' + permissions: contents: read # This is required for actions/checkout id-token: write # Access the Github JWT for AWS access @@ -62,7 +67,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + if: inputs.archive-download-name == '' + uses: actions/checkout@v4 + - name: Archive download + if: inputs.archive-download-name != '' + uses: actions/download-artifact@v4 + with: + name: ${{inputs.archive-download-name}} - name: Build Docker Image uses: ./.github/actions/containerize with: @@ -83,7 +94,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + if: inputs.archive-download-name == '' + uses: actions/checkout@v4 + - name: Archive download + if: inputs.archive-download-name != '' + uses: actions/download-artifact@v4 + with: + name: ${{inputs.archive-download-name}} # Get the AWS credentials - name: AWS Credentials uses: aws-actions/configure-aws-credentials@v4 @@ -119,7 +136,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + if: inputs.archive-download-name == '' + uses: actions/checkout@v4 + - name: Archive download + if: inputs.archive-download-name != '' + uses: actions/download-artifact@v4 + with: + name: ${{inputs.archive-download-name}} # Get the AWS credentials - name: AWS Credentials uses: aws-actions/configure-aws-credentials@v4