Skip to content

Commit

Permalink
feat: refactor workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmardefago committed Dec 26, 2022
1 parent 2333c39 commit b8ff299
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 9 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/deploy-goerli-arbitrum-subgraph.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Production Subgraph (Arbitrum Goerli)

on:
push:
tags:
- v*

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
deploy:
uses: graphprotocol/graph-network-subgraph/.github/workflows/template-deploy.yaml@master
with:
ENVIRONMENT: production-arbitrum-goerli
CONFIG: arbitrumGoerliAddressScript.ts
secrets:
NODE_AUTH_TOKEN: ${{ secrets.graphprotocol_npm_token }}
ACCESS_TOKEN: ${{ secrets.access_token }}
20 changes: 20 additions & 0 deletions .github/workflows/deploy-production-arbitrum-subgraph.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Production Subgraph (Arbitrum)

on:
push:
tags:
- v*

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
deploy:
uses: graphprotocol/graph-network-subgraph/.github/workflows/template-deploy.yaml@master
with:
ENVIRONMENT: production-arbitrum
CONFIG: mainnetArbitrumAddressScript.ts
secrets:
NODE_AUTH_TOKEN: ${{ secrets.graphprotocol_npm_token }}
ACCESS_TOKEN: ${{ secrets.access_token }}
2 changes: 1 addition & 1 deletion .github/workflows/deploy-production-subgraph.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Production Subgraph (Goerli)
name: Production Subgraph (Mainnet)

on:
push:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/deploy-staging-arbitrum-subgraph.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Staging Subgraph (Arbitrum)

on:
push:
branches:
- mainnet-staging

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
deploy:
uses: graphprotocol/graph-network-subgraph/.github/workflows/template-deploy.yaml@master
with:
ENVIRONMENT: staging-arbitrum
CONFIG: mainnetArbitrumAddressScript.ts
secrets:
NODE_AUTH_TOKEN: ${{ secrets.graphprotocol_npm_token }}
ACCESS_TOKEN: ${{ secrets.access_token }}
21 changes: 13 additions & 8 deletions .github/workflows/template-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,36 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set staging environment variables
if: ${{ inputs.ENVIRONMENT == 'staging' }}
- name: Set arbitrum staging environment variables
if: ${{ inputs.ENVIRONMENT == 'staging-arbitrum' }}
run: |
echo "ENV_SUFFIX=-staging" >> $GITHUB_ENV
echo "ENV_SUFFIX=-arbitrum-staging" >> $GITHUB_ENV
- name: Set mainnet staging environment variables
if: ${{ inputs.ENVIRONMENT == 'staging-mainnet' }}
run: |
echo "ENV_SUFFIX=-mainnet-staging" >> $GITHUB_ENV
- name: Set testnet environment variables
if: ${{ inputs.ENVIRONMENT == 'testnet' }}
run: |
echo "ENV_SUFFIX=-testnet" >> $GITHUB_ENV
- name: Set mainnet environment variables
if: ${{ inputs.ENVIRONMENT == 'production' }}
run: |
echo "ENV_SUFFIX=-mainnet" >> $GITHUB_ENV
- name: Set arbitrum environment variables
if: ${{ inputs.ENVIRONMENT == 'production-arbitrum' }}
run: |
echo "ENV_SUFFIX=-arbitrum" >> $GITHUB_ENV
- name: Set goerli production environment variables
if: ${{ inputs.ENVIRONMENT == 'production-goerli' }}
run: |
echo "ENV_SUFFIX=-goerli" >> $GITHUB_ENV
- name: Set arbitrum goerli production environment variables
if: ${{ inputs.ENVIRONMENT == 'production-arbitrum-goerli' }}
run: |
echo "ENV_SUFFIX=-arbitrum-goerli" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3

Expand Down

0 comments on commit b8ff299

Please sign in to comment.