getting-started/account-access/connecting-github-spacelift.md
Connecting GitHub and Spacelift
To streamline the workflow and enable seamless integration between GitHub and Spacelift, you’ll need to connect your GitHub account and repositories to Spacelift. This allows Spacelift to access your Terraform code stored in GitHub and manage the infrastructure deployment process.
Connecting GitHub to Spacelift
- Log in to your Spacelift account and navigate to your organization.
- Click on the “Integrations” tab and select “GitHub” from the list of available integrations.
- Follow the prompts to authorize Spacelift to access your GitHub account and repositories.
- Once the integration is set up, you can select the GitHub repositories you want to connect to Spacelift.
Creating a Spacelift Project
- In Spacelift, navigate to your organization and click on the “Create Project” button.
- Select the “GitHub” option as the source for your project.
- Choose the GitHub repository containing your Terraform code.
- Configure any additional settings or options as needed, such as specifying the Terraform working directory or variables.
- Click “Create Project” to finalize the setup.
Managing Workspaces and Runs
After creating your Spacelift project, you can manage workspaces and runs directly from the Spacelift interface:
- Navigate to your project and click on the “Workspaces” tab.
- Create a new workspace or select an existing one to manage.
- Within a workspace, you can trigger Terraform runs (plan, apply, destroy) and view the output and logs.
- Collaborate with your team by leaving comments, reviewing changes, and approving runs.
By connecting GitHub and Spacelift, you can streamline your infrastructure as code workflow, leverage version control for your Terraform code, and take advantage of Spacelift’s powerful collaboration and deployment features.