Skip to content

Merge pull request #362 from connext/deployment-trigger #276

Merge pull request #362 from connext/deployment-trigger

Merge pull request #362 from connext/deployment-trigger #276

Workflow file for this run

name: Deploy S3 Assets
on:
push:
branches: [main]
jobs:
terraform-deploy-assets:
env:
CF_DISTRIBUTION_ID: E1W1OZ8FEAK8E7
runs-on: ubuntu-latest
name: Deploy file to s3 + cloudfront
steps:
- name: Checkout
uses: actions/checkout@master
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Filter empty domain ids
run: cat crossChain.json | jq 'del(.[] | select(.chainId == null))' > crossChain.tmp && mv -f crossChain.tmp crossChain.json
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.5.7
- name: Terraform Plan
run: terraform init
- name: Terraform Plan
run: terraform plan
- name: Terraform Deploy
run: terraform apply -auto-approve
- name: Invalidate Cloudfront Distribution
run: aws cloudfront create-invalidation --distribution-id $CF_DISTRIBUTION_ID --paths '/chaindata.json'
trigger-sync-chaindata:
runs-on: ubuntu-latest
needs: [terraform-deploy-assets]
steps:
- name: Trigger sync-chaindata workflow in everclear-agents
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.WORKFLOW_DISPATCH_PAT }}" \
https://api.github.com/repos/everclearorg/everclear-agents/dispatches \
-d '{"event_type":"chaindata-sync","client_payload":{"sha":"${{ github.sha }}","ref":"${{ github.ref }}","run_id":"${{ github.run_id }}"}}'