Skip to content

feat: allow to deploy lambda func locally (#96) #25

feat: allow to deploy lambda func locally (#96)

feat: allow to deploy lambda func locally (#96) #25

Workflow file for this run

name: Close Pull Request
# only trigger on pull request closed events
on:
pull_request:
types: [closed]
jobs:
close_job:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
env:
# All TF variables are define din Terraform Cloud
AWS_REGION: "eu-central-1"
TFE_TOKEN: ${{ secrets.TFE_TOKEN }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # ratchet:aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::053932140667:role/mongulu-github
role-session-name: mtchoun-mouh-deployment
aws-region: eu-central-1
- name: Checkout
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # ratchet:actions/checkout@v2
- name: Install terraform
uses: hashicorp/setup-terraform@d22444889af304a44b997011fbabb81ff705a7b4 # ratchet:hashicorp/[email protected]
- name: Checkout
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # ratchet:actions/checkout@v2
- name: Install terraform
uses: hashicorp/setup-terraform@d22444889af304a44b997011fbabb81ff705a7b4 # ratchet:hashicorp/[email protected]
- name: Terraform fmt
id: fmt
run: |
cd infra
terraform fmt -check
continue-on-error: true
- name: Terraform Init
id: init
run: |
cd infra
export TF_WORKSPACE=$GITHUB_HEAD_REF
terraform init -backend-config="token=$TFE_TOKEN"
- name: setup workspace
id: workspace
run: |
cd infra
terraform workspace select $GITHUB_HEAD_REF
- name: Terraform Destroy
id: destroy
run: |
cd infra
terraform destroy -auto-approve
terraform workspace select master
terraform workspace delete $GITHUB_HEAD_REF