Skip to content

Commit

Permalink
Pass params to serverless via .env
Browse files Browse the repository at this point in the history
  • Loading branch information
lightwalker-eth committed Sep 25, 2024
1 parent 082125f commit b966a5b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/nameguard-api-lambda-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ jobs:
- name: Copy LICENSE to api directory
run: cp LICENSE api/

- name: Create .env file
run: |
echo "PROVIDER_URI_MAINNET=${{ secrets.PROVIDER_URI_MAINNET }}" >> .env
echo "PROVIDER_URI_SEPOLIA=${{ secrets.PROVIDER_URI_SEPOLIA }}" >> .env
echo "ALCHEMY_URI_MAINNET=${{ secrets.ALCHEMY_URI_MAINNET }}" >> .env
echo "ALCHEMY_URI_SEPOLIA=${{ secrets.ALCHEMY_URI_SEPOLIA }}" >> .env
echo "ENS_SUBGRAPH_URL_MAINNET=${{ secrets.ENS_SUBGRAPH_URL_MAINNET }}" >> .env
echo "ENS_SUBGRAPH_URL_SEPOLIA=${{ secrets.ENS_SUBGRAPH_URL_SEPOLIA }}" >> .env
working-directory: api

- name: Build and deploy lambda
env:
PROVIDER_URI_MAINNET: ${{ secrets.PROVIDER_URI_MAINNET }}
Expand Down
13 changes: 7 additions & 6 deletions api/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ provider:

plugins:
- serverless-prune-plugin
- serverless-dotenv-plugin

functions:
oss-nameguard:
Expand All @@ -38,12 +39,12 @@ functions:
tags:
Stage: ${self:custom.stage}
environment:
PROVIDER_URI_MAINNET: ${param:PROVIDER_URI_MAINNET}
PROVIDER_URI_SEPOLIA: ${param:PROVIDER_URI_SEPOLIA}
ALCHEMY_URI_MAINNET: ${param:ALCHEMY_URI_MAINNET}
ALCHEMY_URI_SEPOLIA: ${param:ALCHEMY_URI_SEPOLIA}
ENS_SUBGRAPH_URL_MAINNET: ${param:ENS_SUBGRAPH_URL_MAINNET}
ENS_SUBGRAPH_URL_SEPOLIA: ${param:ENS_SUBGRAPH_URL_SEPOLIA}
PROVIDER_URI_MAINNET: ${env:PROVIDER_URI_MAINNET}
PROVIDER_URI_SEPOLIA: ${env:PROVIDER_URI_SEPOLIA}
ALCHEMY_URI_MAINNET: ${env:ALCHEMY_URI_MAINNET}
ALCHEMY_URI_SEPOLIA: ${env:ALCHEMY_URI_SEPOLIA}
ENS_SUBGRAPH_URL_MAINNET: ${env:ENS_SUBGRAPH_URL_MAINNET}
ENS_SUBGRAPH_URL_SEPOLIA: ${env:ENS_SUBGRAPH_URL_SEPOLIA}


resources:
Expand Down

0 comments on commit b966a5b

Please sign in to comment.