docs: remove legacy terraform #16
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
| # GitHub Actions CI for Python and Terraform, and CD for AWS/GCP | |
| name: CI/CD | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| ci: | |
| name: Python & Terraform CI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Lint Python | |
| uses: astral-sh/ruff-action@v3 | |
| - name: Run tests | |
| run: uv run pytest tests | |
| - name: Set up Terraform | |
| uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: 1.7.5 | |
| - name: Terraform fmt | |
| run: terraform fmt -check -recursive | |
| - name: Terraform init | |
| run: terraform init | |
| - name: Terraform validate (AWS) | |
| run: terraform validate | |
| working-directory: ./modules/bedrock_agentic_ds_team | |
| - name: Terraform validate (GCP) | |
| run: terraform validate | |
| working-directory: ./modules/gcp_agentic_ds_team | |
| cd: | |
| name: Deploy to Cloud (AWS or GCP) | |
| needs: ci | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Terraform | |
| uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: 1.7.5 | |
| - name: Configure AWS credentials | |
| if: ${{ contains(github.event.head_commit.modified, 'bedrock_agentic_ds_team') || contains(github.event.head_commit.modified, 'modules/bedrock_agentic_ds_team') }} | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-east-1 | |
| - name: Deploy to AWS (Terraform apply) | |
| if: ${{ contains(github.event.head_commit.modified, 'bedrock_agentic_ds_team') || contains(github.event.head_commit.modified, 'modules/bedrock_agentic_ds_team') }} | |
| run: | | |
| terraform init | |
| terraform apply -auto-approve | |
| working-directory: . | |
| - name: Set up Google Cloud | |
| if: ${{ contains(github.event.head_commit.modified, 'gcp_agentic_ds_team') || contains(github.event.head_commit.modified, 'modules/gcp_agentic_ds_team') }} | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| credentials_json: ${{ secrets.GCP_CREDENTIALS_JSON }} | |
| - name: Set up gcloud CLI | |
| if: ${{ contains(github.event.head_commit.modified, 'gcp_agentic_ds_team') || contains(github.event.head_commit.modified, 'modules/gcp_agentic_ds_team') }} | |
| uses: google-github-actions/setup-gcloud@v2 | |
| with: | |
| project_id: ${{ secrets.GCP_PROJECT_ID }} | |
| - name: Deploy to GCP (Terraform apply) | |
| if: ${{ contains(github.event.head_commit.modified, 'gcp_agentic_ds_team') || contains(github.event.head_commit.modified, 'modules/gcp_agentic_ds_team') }} | |
| run: | | |
| terraform init | |
| terraform apply -auto-approve | |
| working-directory: . |