Created
December 3, 2021 07:56
-
-
Save itsmunim/76d9be4ddb1be720044310972a8c8b13 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: provision-infra | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: setup-and-deployment | |
env: | |
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }} | |
SPACES_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY_ID }} | |
SPACES_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_ACCESS_KEY }} | |
run: | | |
# install terraform | |
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 | |
# apply infra changes | |
cd terraform/ # this is where your terraform infra yaml is | |
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