Skip to content

Commit

Permalink
Add infra deploy steps
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeshanAhsan1 committed Jun 12, 2024
1 parent ab73786 commit bbce766
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,32 @@ env:
PRIVATE_SSH_KEY: ${{ secrets.AWS_SSH_KEY_PRIVATE }}
PUBLIC_SSH_KEY: ${{ secrets.AWS_SSH_KEY_PUBLIC }}
AWS_REGION: us-east-2

jobs:
deploy-infra:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_wrapper: false
- name: Terraform Init
id: init
run: terraform init -backend-config="bucket=$TF_STATE_BUCKET_NAME" -backend-config="region=us-east-2"
working-directory: ./terraform
- name: Terraform Plan
id: plan
run: |-
terraform plan \
-var="region=us-east-2" \
-var="public_key=$PUBLIC_SSH_KEY" \
-var="private_key=$PRIVATE_SSH_KEY" \
-var="key_name=deployer-key" \
-out=PLAN
working-directory: ./terraform
- name: Terraform Apply
id: apply
run: terraform apply PLAN
working-directory: ./terraform

0 comments on commit bbce766

Please sign in to comment.