Skip to content

Automating Terraform with GitHub Actions for Continuous Integration on Google Cloud Platform. Tech Stack --> [bash, wordpress, gcp, terraform, workflows, github-actions, apache2, php]

License

Notifications You must be signed in to change notification settings

vishalbidwe/gcp-terraform-cicd-github-actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automating Terraform with GitHub Actions for Continuous Integration on Google Cloud Platform

This repository showcases the deployment of a WordPress server on Google Cloud Platform and demonstrates the utilization of GitHub Actions to create a flexible, native continuous integration pipeline for Terraform. GitHub Actions eliminates the need for external tooling by enabling syntax validation, resource testing, and quality maintenance of Terraform modules during configuration changes. The document provides a step-by-step guide to automate Terraform with GitHub Actions on GCP, assuming familiarity with Terraform, Git, and GCP. Prerequisites include installing Terraform, setting up GitHub and GCP accounts, and creating a service account with the necessary roles.

The workflow involves checking configuration formatting, generating a plan for pull requests, and applying the configuration when updating the master branch. The sample code is available on GitHub.

To set up the workflow, a workflow file is created in the GitHub repository. The workflow checks out the code, sets up Terraform CLI, initializes, formats, plans, and applies the configuration. Google credentials are stored in GitHub Secrets as a JSON string.

A feature branch demonstrates the workflow, and the pull request triggers a check that runs the workflow without the apply step. Merging the pull request into the master branch executes the workflow with the apply step.

The document concludes by highlighting the flexibility and native continuous integration capabilities of GitHub Actions for Terraform on GCP, enabling efficient validation, testing, and quality maintenance during configuration changes.This repository showcases the deployment of a WordPress server on Google Cloud Platform.

Techstack

typescript gcloud

About

Automating Terraform with GitHub Actions for Continuous Integration on Google Cloud Platform. Tech Stack --> [bash, wordpress, gcp, terraform, workflows, github-actions, apache2, php]

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published