-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ft/addGitHubProvider
- Loading branch information
Showing
920 changed files
with
539,354 additions
and
144,514 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
NODE_ENV=development | ||
|
||
# Mainnet | ||
NETWORK_ID=mainnet | ||
# Testnet - Taurus | ||
# NETWORK_ID=taurus | ||
|
||
LOG_LEVEL=debug | ||
|
||
# Mainnet | ||
NODE_DOCKER_TAG=mainnet-2024-nov-13 | ||
# Testnet - Taurus | ||
# NODE_DOCKER_TAG=taurus-2024-nov-05 | ||
|
||
DB_USER=postgres | ||
DB_DATABASE=postgres | ||
DB_PASSWORD=postgres | ||
DB_PORT=5432 | ||
DB_HOST=postgres | ||
|
||
# Mainnet | ||
RPC_URLS="ws://caddy:8000" | ||
CHAIN_ID="0x66455a580aabff303720aa83adbe6c44502922251c03ba73686d5245da9e21bd" | ||
|
||
# Testnet - Taurus | ||
# RPC_URLS="ws://caddy:8000 | ||
# CHAIN_ID="0x295aeafca762a304d92ee1505548695091f6082d3f0aa4d092ac3cd6397a6c5e" | ||
|
||
HASURA_GRAPHQL_PORT=8080 | ||
HASURA_GRAPHQL_ADMIN_SECRET=helloworld | ||
|
||
# In local dev, we want to disable this to run the metadata first and run console in another terminal | ||
HASURA_GRAPHQL_ENABLE_CONSOLE=true | ||
HASURA_GRAPHQL_JWT_SECRET='{"type":"HS256","key":"this_is_a_mock_secret_with_32_chars"}' | ||
HASURA_GRAPHQL_CORS_DOMAIN="*" | ||
|
||
# Mainnet | ||
DICTIONARY_DIRECTORY=autonomys | ||
# Testnet - Taurus | ||
# DICTIONARY_DIRECTORY=autonomys-taurus | ||
DICTIONARY_SUBQUERY_NODE_PORT=3000 | ||
DICTIONARY_URL="http://localhost:3000" | ||
|
||
REDIS_PORT=6379 | ||
|
||
BULL_USERNAME=bull | ||
BULL_PASSWORD=board | ||
BULL_PORT=3020 | ||
BULL_SESSION_SECRET=keyboardcat | ||
|
||
NR_API_KEY="" | ||
NR_AGENT_IDENTIFIER="" | ||
|
||
SLACK_TOKEN="" | ||
SLACK_CONVERSATION_ID="" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Add environment variables here to override those in the .env file. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Add environment variables here to override those in the .env file. |
Binary file not shown.
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Deploy Subql Green (staging) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "indexers/**" | ||
env: | ||
DOCKER_HOST: ssh://${{ secrets.SSH_USER }}@${{ secrets.SUBQL_HOST }} | ||
DEPLOY_PATH: /home/${{ secrets.SSH_USER }}/astral | ||
BRANCH_NAME: ${{ github.ref_name }} | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set Hasura secret | ||
id: set_secret | ||
run: echo "hasura_secret=${{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }}" >> $GITHUB_ENV | ||
|
||
- name: Install SSH key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SERVER_SSH_PRIVATE_KEY }} | ||
|
||
- name: Add SSH host key fingerprint | ||
run: | | ||
ssh-keyscan -H ${{ secrets.SUBQL_HOST }} >> ~/.ssh/known_hosts | ||
- name: Deploy with Docker Compose | ||
env: | ||
SSH_USER: ${{ secrets.SSH_USER }} | ||
HASURA_GRAPHQL_ADMIN_SECRET: ${{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }} | ||
HASURA_GRAPHQL_JWT_SECRET: ${{ secrets.HASURA_GRAPHQL_JWT_SECRET }} | ||
run: | | ||
mkdir -p ~/.ssh | ||
ssh-keyscan -H ${{ secrets.SUBQL_HOST }} >> ~/.ssh/known_hosts | ||
ssh ${SSH_USER}@${{ secrets.SUBQL_HOST }} " | ||
if [ ! -d ${DEPLOY_PATH} ]; then | ||
git clone https://github.com/autonomys/astral.git ${DEPLOY_PATH} | ||
else | ||
cd ${DEPLOY_PATH} | ||
git pull | ||
fi | ||
git checkout ${BRANCH_NAME} | ||
# Securely update the .env file | ||
if [ ! -f .env ]; then | ||
echo 'HASURA_GRAPHQL_ADMIN_SECRET=${{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }}' > .env | ||
echo 'HASURA_GRAPHQL_JWT_SECRET=${{ secrets.HASURA_GRAPHQL_JWT_SECRET }}' >> .env | ||
else | ||
sed -i '/^HASURA_GRAPHQL_ADMIN_SECRET=/d' .env | ||
echo 'HASURA_GRAPHQL_ADMIN_SECRET=${{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }}' >> .env | ||
sed -i '/^HASURA_GRAPHQL_JWT_SECRET=/d' .env | ||
echo 'HASURA_GRAPHQL_JWT_SECRET=${{ secrets.HASURA_GRAPHQL_JWT_SECRET }}' >> .env | ||
fi | ||
export $(grep -v '^#' /home/${{ secrets.SSH_USER }}/astral/.env | xargs) | ||
cd /home/${{ secrets.SSH_USER }}/astral/indexers | ||
yarn build-dictionary | ||
npx lerna run codegen | ||
npx lerna run build | ||
sudo docker compose -p prod-astral-indexers -f /home/${{ secrets.SSH_USER }}/astral/docker-compose.yml -f /home/${{ secrets.SSH_USER }}/astral/docker-compose.prod.yml --profile dictionary --profile task --profile taurus up -d --remove-orphans | ||
echo 'Installation Complete' | ||
" | ||
- name: Notify on failure | ||
if: failure() | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
status: ${{ job.status }} | ||
fields: repo,message,commit,author,action,eventName,ref,workflow,job | ||
author_name: Deployment failed | ||
mention: here | ||
if_mention: failure,cancelled | ||
job_name: Deploy Subql Green (staging) | ||
channel: alerts | ||
icon_emoji: ":github:" |
Oops, something went wrong.