adding cd into terraform folder #29
This file contains 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
name: Tech Report API Pipeline | |
on: [push] | |
env: | |
PIPELINE_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | |
PIPELINE_SA_KEY: ${{ secrets.GCP_SA_KEY }} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest | |
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi | |
- name: Test with pytest | |
run: | | |
python -m pytest -W "ignore" | |
deploy_development: | |
if: github.ref == 'refs/heads/development' | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Google Cloud Auth | |
uses: 'google-github-actions/auth@v2' | |
with: | |
project_id: ${{ env.PIPELINE_PROJECT_ID }} | |
credentials_json: ${{ env.PIPELINE_SA_KEY }} | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v3 | |
- name: Terraform Init | |
run: | | |
cd terraform/dev/ | |
terraform init | |
- name: Terraform Plan | |
id: plan | |
run: | | |
cd terraform/dev/ | |
terraform plan -no-color | |
continue-on-error: true |