Skip to content

Instantly share code, notes, and snippets.

@itsmunim
Last active December 18, 2022 07:54
Show Gist options
  • Save itsmunim/2812154b9ee3784edde1a59849a46115 to your computer and use it in GitHub Desktop.
Save itsmunim/2812154b9ee3784edde1a59849a46115 to your computer and use it in GitHub Desktop.
name: apply-iac
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup-and-deployment
env:
SECRETHUB_CREDENTIAL: ${{ secrets.SECRETHUB_CREDENTIAL }}
run: |
# Setup secrethub cli & terraform
echo "deb [trusted=yes] https://apt.secrethub.io stable main" | sudo tee /etc/apt/sources.list.d/secrethub.sources.list
sudo apt-get update && sudo apt-get install -y secrethub-cli gnupg software-properties-common curl
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update && sudo apt-get install terraform
terraform -version
# Then we apply the tf scripts
cd terraform/
terraform init
terraform plan -out .terraform-plan
terraform apply .terraform-plan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment