Skip to content

feat: allow for publish from GitHub Actions #1

feat: allow for publish from GitHub Actions

feat: allow for publish from GitHub Actions #1

Workflow file for this run

name: ci
on:
push:
branches:
- main
env:
tf_version: 1.5.7
tg_version: 0.53.0
working_dir: infra/lambda
TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/.terraform.d/plugin-cache
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
environment: prod
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Terraform Plugin Cache Dir
run: mkdir -p $TF_PLUGIN_CACHE_DIR
- name: Terraform Plugin Cache
uses: actions/cache@v4
with:
path: ${{ env.TF_PLUGIN_CACHE_DIR }}
key: ${{ runner.os }}-terraform-plugin-cache-${{ hashFiles('**/.terraform.lock.hcl') }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
role-session-name: ci-${{ github.ref_name }}-${{ github.run_id }}
aws-region: ${{ vars.AWS_REGION }}
- name: Deploy
uses: gruntwork-io/terragrunt-action@v2
env:
TF_TOKEN_app_terraform_io: ${{ secrets.TF_TOKEN_app_terraform_io }}
with:
tf_version: ${{ env.tf_version }}
tg_version: ${{ env.tg_version }}
tg_dir: ${{ env.working_dir }}
tg_command: apply