The Shared Library provides reusable GitHub Actions workflows and Terraform configurations to streamline and standardize deployment processes. This library includes workflows for deploying infrastructure, managing AWS resources, and integrating with Terraform and Kubernetes.
To use the workflows and configurations provided in this library, follow these steps:
-
Clone the Repository
git clone https://github.com/your-organization/shared-library.git cd shared-library
-
Configure GitHub Secrets
Ensure you have the necessary secrets configured in your GitHub repository. Required secrets include:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
TF_CLOUD_TOKEN
AWS_REGION
You can set these secrets in your GitHub repository settings under
Settings
>Secrets and variables
>Actions
. -
Configure Terraform Cloud Token
Add the Terraform Cloud token to your GitHub secrets under the name
TF_CLOUD_TOKEN
. -
Directory Structure
The repository contains the following key directories and files:
.github/workflows/
: Contains GitHub Actions workflows for deployment and other tasks.terraform/
: Contains Terraform configurations for infrastructure deployment.
The library includes reusable GitHub Actions workflows. To use a workflow in your repository:
-
Reference the Workflow
In your
.github/workflows
directory, create or update a workflow YAML file to call the shared workflow:name: Example Workflow on: push: branches: - main jobs: example: uses: your-organization/shared-library/.github/workflows/example-workflow.yml@main with: example-input: "value"
-
Inputs and Outputs
Each workflow may require specific inputs and produce outputs. Refer to the workflow documentation for details on available inputs and outputs.
To use the Terraform configurations provided by the library:
-
Initialize Terraform
In your Terraform project directory, initialize Terraform:
terraform init
-
Configure Your Terraform Files
Reference the modules or configurations provided by the shared library in your Terraform files:
module "example" { source = "your-organization/shared-library/terraform/example" version = "1.0.0" # Module inputs }
-
Apply Terraform Configurations
Apply the configurations to provision your resources:
terraform apply
We welcome contributions to the Shared Library! To contribute:
-
Fork the Repository
Click the "Fork" button on GitHub to create your own copy of the repository.
-
Create a Branch
Create a new branch for your changes:
git checkout -b feature/new-feature
-
Make Your Changes
Edit files, add features, or fix issues as needed.
-
Submit a Pull Request
Push your changes to your fork and create a pull request against the
main
branch of the original repository. -
Follow the Code of Conduct
Ensure that your contributions adhere to our Code of Conduct.
This repository is licensed under the MIT License.
For more information, please refer to the documentation provided within the workflows and Terraform modules or contact the repository maintainers.
- Update Repository URLs: Replace placeholder URLs and repository names with your actual organization’s repository URLs.
- Add Detailed Descriptions: If you have specific modules or workflows, include detailed descriptions of their purpose and usage.
- Add More Sections: Depending on your library’s features, you might want to include additional sections like
Troubleshooting
,FAQs
, orRelease Notes
.