Skip to content

Instantly share code, notes, and snippets.

@soerenmartius
Last active March 29, 2020 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soerenmartius/3eef5b91bd76457070e9a3281e00943e to your computer and use it in GitHub Desktop.
Save soerenmartius/3eef5b91bd76457070e9a3281e00943e to your computer and use it in GitHub Desktop.
SemaphoreCI Terraform Deployment Pipeline.
version: v1.0
name: "Deploy to GitHub"
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
global_job_config:
env_vars:
- name: BUILD_TOOLS_VERSION
value: v0.1.1
- name: TF_IN_AUTOMATION
value: "yes"
- name: TERRAFORM_PLANFILE
value: "out.tfplan"
secrets:
- name: github_access_token
- name: aws_access_credentials
prologue:
commands:
- checkout --use-cache
blocks:
- name: "Deploy"
task:
prologue:
commands:
- cache restore terraform-wd-$SEMAPHORE_GIT_BRANCH
- cache restore terraform-planfile-$SEMAPHORE_GIT_BRANCH
jobs:
- name: "Terraform Apply"
commands:
- make terraform-apply
- cache clear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment