From 8b0ac85ad1079f1ff4d960236abf059a94d29034 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 2 Feb 2026 23:19:25 +0000 Subject: [PATCH] dont use cache --- .../actions/actions/lambda-deploy/action.yml | 86 ------------------- .../actions/terraform-deploy/action.yml | 55 ------------ .github/workflows/deploy_terraform.yml | 3 +- 3 files changed, 1 insertion(+), 143 deletions(-) delete mode 100644 .github/workflows/actions/actions/lambda-deploy/action.yml delete mode 100644 .github/workflows/actions/actions/terraform-deploy/action.yml diff --git a/.github/workflows/actions/actions/lambda-deploy/action.yml b/.github/workflows/actions/actions/lambda-deploy/action.yml deleted file mode 100644 index 3ca0fc8d..00000000 --- a/.github/workflows/actions/actions/lambda-deploy/action.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: "Build and Push Lambda Image to ECR" -description: "Reusable action for building and pushing lambda Docker image to ECR" - -inputs: - ecr_name: - description: "Lambda name / ECR repo name" - required: true - dockerfile_path: - description: "Path to Dockerfile" - required: true - ecr_tf_dir: - description: "Path to ECR terraform directory" - required: true - lambda_tf_dir: - description: "Path to Lambda terraform directory" - required: true - aws-access-key-id: - description: "AWS access key" - required: true - aws-secret-access-key: - description: "AWS secret key" - required: true - aws-region: - description: "AWS region" - required: true - git-sha: - description: "Git commit SHA" - required: true - git-ref: - description: "Git ref name" - required: true - -runs: - using: "composite" - steps: - - uses: actions/checkout@v4 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ inputs.aws-access-key-id }} - aws-secret-access-key: ${{ inputs.aws-secret-access-key }} - aws-region: ${{ inputs.aws-region }} - - - name: Log in to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 - - - name: Deploy ECR - uses: ./.github/workflows/actions/terraform-deploy - with: - working_directory: ${{ inputs.ecr_tf_dir }} - aws-access-key-id: ${{ inputs.aws-access-key-id }} - aws-secret-access-key: ${{ inputs.aws-secret-access-key }} - aws-region: ${{ inputs.aws-region }} - - name: Set Docker image tag - id: set_tag - shell: bash - run: | - SHORT_SHA=$(echo "${{ inputs.git-sha }}" | cut -c1-7) - BRANCH=$(echo "${{ inputs.git-ref }}" | tr '/' '-') - TAG="${BRANCH}-${SHORT_SHA}" - echo "IMAGE_TAG=${TAG}" >> $GITHUB_ENV - echo "tag=$TAG" >> $GITHUB_OUTPUT - - - name: Build and push Docker image - shell: bash - run: | - IMAGE_URI=${{ steps.login-ecr.outputs.registry }}/${{ inputs.ecr_name }}:${{ steps.set_tag.outputs.tag }} - echo "Building Docker image for ${{ inputs.ecr_name }}..." - docker build -t $IMAGE_URI -f ${{ inputs.dockerfile_path }} . - - echo "Pushing to ECR..." - docker push $IMAGE_URI - - - name: Deploy Lambda - uses: ./.github/workflows/actions/terraform-deploy - with: - working_directory: ${{ inputs.lambda_tf_dir }} - aws-access-key-id: ${{ inputs.aws-access-key-id }} - aws-secret-access-key: ${{ inputs.aws-secret-access-key }} - aws-region: ${{ inputs.aws-region }} - lambda-image-tag: ${{ steps.set_tag.outputs.tag }} - - - diff --git a/.github/workflows/actions/actions/terraform-deploy/action.yml b/.github/workflows/actions/actions/terraform-deploy/action.yml deleted file mode 100644 index 56133299..00000000 --- a/.github/workflows/actions/actions/terraform-deploy/action.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: "Terraform Plan Shared Config" -description: "Plans shared Terraform config for Lambdas" - -inputs: - working_directory: - description: "Directory containing Terraform config" - required: true - aws-access-key-id: - description: "AWS access key" - required: true - aws-secret-access-key: - description: "AWS secret key" - required: true - aws-region: - description: "AWS region" - required: true - lambda-image-tag: - description: "Tag of the Lambda image (e.g., GitHub SHA)" - required: false - -runs: - using: "composite" - steps: - - uses: actions/checkout@v4 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ inputs.aws-access-key-id }} - aws-secret-access-key: ${{ inputs.aws-secret-access-key }} - aws-region: ${{ inputs.aws-region }} - - - name: Setup Terraform - uses: hashicorp/setup-terraform@v3 - - - name: Terraform Init - working-directory: ${{ inputs.working_directory }} - shell: bash - run: terraform init -reconfigure - - - name: Terraform Plan - working-directory: ${{ inputs.working_directory }} - shell: bash - run: | - if [ -n "${{ inputs.lambda-image-tag }}" ]; then - terraform plan -out=tfplan -var="lambda_image_tag=${{ inputs.lambda-image-tag }}" - else - terraform plan -out=tfplan - fi - - - name: Terraform Apply - working-directory: ${{ inputs.working_directory }} - shell: bash - run: terraform apply -auto-approve tfplan - diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index c306e69b..fe3ca9b2 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -45,7 +45,7 @@ jobs: # Deploy shared terrform things - name: Terraform Init - run: cd infrastructure/terraform/shared && terraform init + run: cd infrastructure/terraform/shared && terraform init -upgrade - name: Terraform Workspace run: | @@ -64,4 +64,3 @@ jobs: terraform apply -auto-approve -var-file=dev.tfvars - \ No newline at end of file