Merge pull request #95 from perpetual-protocol/feature/deploy-prod #32
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: Deploy Production (Optimism) | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy-the-graph: | |
runs-on: ubuntu-latest | |
environment: optimism | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- name: Install | |
run: npm ci | |
- name: Deploy to The Graph | |
run: | | |
npx graph auth --product hosted-service ${{ secrets.THE_GRAPH_ACCESS_TOKEN }} | |
npm run deploy-the-graph:optimism | |
deploy-self-hosted: | |
runs-on: ubuntu-latest | |
environment: optimism | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- name: Install | |
run: npm ci | |
- name: Configure AWS Credentials - aws eks update-kubeconfig | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: "${{ secrets.AWS_SUBGRAPH_DEPLOYER_ACCESS_KEY_ID }}" | |
aws-secret-access-key: "${{ secrets.AWS_SUBGRAPH_DEPLOYER_SECRET_ACCESS_KEY }}" | |
aws-region: ap-southeast-1 | |
- name: Setup kubeconfig | |
env: | |
AWS_REGION: ap-southeast-1 | |
AWS_EKS_CLUSTER: perp-production | |
run: | | |
aws eks --region $AWS_REGION update-kubeconfig --name $AWS_EKS_CLUSTER | |
# https://github.com/aws/aws-cli/issues/6920 | |
- name: Fix invalid apiVersion client.authentication.k8s.io/v1alpha1 | |
uses: azure/setup-kubectl@v2.0 | |
with: | |
version: "v1.23.6" | |
- name: Deploy to Self-hosted Graph Node Cluster | |
run: | | |
kubectl port-forward service/graph-node-cluster-index 8020:8020 & | |
npm run deploy-self-hosted:optimism | |
deploy-satsuma: | |
runs-on: ubuntu-latest | |
environment: optimism | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- name: Install | |
run: npm ci | |
- name: Deploy to Satsuma | |
run: | | |
npm run deploy-satsuma:optimism | |
env: | |
SATSUMA_DEPLOY_KEY: "${{ secrets.SATSUMA_DEPLOY_KEY }}" | |
notify: | |
needs: [deploy-the-graph, deploy-self-hosted, deploy-satsuma] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Send message to Discord | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }} | |
uses: Ilshidur/action-discord@master | |
with: | |
args: >- | |
**[production]** Perp v2 Subgraph deployed (Optimism) | |
Commit: ${{ github.sha }} | |
Branch: ${{ github.ref }} |