Skip to content

feat(query): add tests for IndexingService.Query function #133

feat(query): add tests for IndexingService.Query function

feat(query): add tests for IndexingService.Query function #133

Workflow file for this run

name: Terraform
on:
push:
branches:
- main
tags:
- "*"
paths:
- ".github/workflows/terraform.yml"
- "cmd/**"
- "deploy/**"
- "pkg/**"
pull_request:
branches: ["main"]
workflow_run:
workflows: [Releaser]
types: [completed]
branches: ["main"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
AWS_ACCOUNT_ID: ${{ secrets.PROD_AWS_ACCOUNT_NUMBER }}
AWS_REGION: us-west-2
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
terraform:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: arn:aws:iam::${{ secrets.PROD_AWS_ACCOUNT_NUMBER }}:role/terraform-ci
- uses: opentofu/setup-opentofu@v1
- uses: actions/setup-go@v5
# always deploy to staging
- name: Set Staging Environment Variables
run: |
echo "ENV=staging" >> $GITHUB_ENV
echo "TF_WORKSPACE=staging" >> $GITHUB_ENV
echo "TF_VAR_private_key=${{ secrets.STAGING_PRIVATE_KEY }}" >> $GITHUB_ENV
echo "TF_VAR_did=did:web:staging.indexer.storacha.network" >> $GITHUB_ENV
- name: Tofu Init
run: |
tofu -chdir="deploy/app" init
- name: Build Go Apps
run: |
touch .env
make lambdas
- name: Terraform Plan
if: github.event_name == 'pull_request'
run: |
tofu -chdir="deploy/app" plan
- name: Terraform Apply
if: github.event_name != 'pull_request'
run: |
tofu -chdir="deploy/app" apply -input=false --auto-approve
# deploy to prod on new releases
- name: Set Production Environment Variables
if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' }}
run: |
echo "ENV=production" >> $GITHUB_ENV
echo "TF_WORKSPACE=prod" >> $GITHUB_ENV
echo "TF_VAR_private_key=${{ secrets.PROD_PRIVATE_KEY }}" >> $GITHUB_ENV
echo "TF_VAR_did=did:web:indexer.storacha.network" >> $GITHUB_ENV
- name: Deploy to prod
if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' }}
run: |
tofu -chdir="deploy/app" apply -input=false --auto-approve