support more networks #19
Workflow file for this run
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: Publish driver-did-iden3 to Privado AWS ECR | |
on: | |
push: | |
tags: | |
- 'v*.*.*-dev' | |
workflow_dispatch: | |
env: | |
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_PRIVADO_ID }} | |
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION_PRIVADO_ID }} | |
ECR_REPOSITORY: driver-did-iden3 | |
jobs: | |
build_driver: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: driver-did-iden3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: ${{ env.AWS_DEFAULT_REGION }} | |
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/PolygonIDActionsRole | |
role-session-name: GitHubActionsSession | |
- name: Login to Amazon ECR | |
uses: aws-actions/amazon-ecr-login@v2 | |
id: login-ecr | |
- name: Build file with supported networks | |
run: | | |
cd driver-did-iden3 | |
echo -e "polygon:" > resolvers.settings.yaml | |
echo -e " amoy:" >> resolvers.settings.yaml | |
echo -e " contractAddress: ${{ env.STATE_POLYGON_AMOY }}" >> resolvers.settings.yaml | |
echo -e " networkURL: ${{ secrets.RPC_POLYGON_AMOY }}" >> resolvers.settings.yaml | |
echo -e " main:" >> resolvers.settings.yaml | |
echo -e " contractAddress: ${{ env.STATE_POLYGON_MAIN }}" >> resolvers.settings.yaml | |
echo -e " networkURL: ${{ secrets.RPC_POLYGON_MAIN }}" >> resolvers.settings.yaml | |
echo -e " cardona:" >> resolvers.settings.yaml | |
echo -e " contractAddress: ${{ env.STATE_UNIFIED }}" >> resolvers.settings.yaml | |
echo -e " networkURL: ${{ secrets.RPC_POLYGON_ZKEVM_CARDONA }}" >> resolvers.settings.yaml | |
echo -e " zkevm:" >> resolvers.settings.yaml | |
echo -e " contractAddress: ${{ env.STATE_UNIFIED }}" >> resolvers.settings.yaml | |
echo -e " networkURL: ${{ secrets.RPC_POLYGON_ZKEVM_MAIN }}" >> resolvers.settings.yaml | |
echo -e "privado:" >> resolvers.settings.yaml | |
echo -e " main:" >> resolvers.settings.yaml | |
echo -e " contractAddress: ${{ env.STATE_UNIFIED }}" >> resolvers.settings.yaml | |
echo -e " networkURL: ${{ secrets.RPC_PRIVADO_MAIN }}" >> resolvers.settings.yaml | |
echo -e " test:" >> resolvers.settings.yaml | |
echo -e " contractAddress: ${{ env.STATE_UNIFIED }}" >> resolvers.settings.yaml | |
echo -e " networkURL: ${{ secrets.RPC_PRIVADO_TEST }}" >> resolvers.settings.yaml | |
echo -e "eth:" >> resolvers.settings.yaml | |
echo -e " main:" >> resolvers.settings.yaml | |
echo -e " contractAddress: ${{ env.STATE_UNIFIED }}" >> resolvers.settings.yaml | |
echo -e " networkURL: ${{ secrets.RPC_ETHEREUM_MAIN }}" >> resolvers.settings.yaml | |
echo -e " sepolia:" >> resolvers.settings.yaml | |
echo -e " contractAddress: ${{ env.STATE_UNIFIED }}" >> resolvers.settings.yaml | |
echo -e " networkURL: ${{ secrets.RPC_ETHEREUM_SEPOLIA }}" >> resolvers.settings.yaml | |
echo -e "linea:" >> resolvers.settings.yaml | |
echo -e " main:" >> resolvers.settings.yaml | |
echo -e " contractAddress: ${{ env.STATE_UNIFIED }}" >> resolvers.settings.yaml | |
echo -e " networkURL: ${{ secrets.RPC_LINEA_MAIN }}" >> resolvers.settings.yaml | |
echo -e " sepolia:" >> resolvers.settings.yaml | |
echo -e " contractAddress: ${{ env.STATE_UNIFIED }}" >> resolvers.settings.yaml | |
echo -e " networkURL: ${{ secrets.RPC_LINEA_SEPOLIA }}" >> resolvers.settings.yaml | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: build and deploy to DockerHub | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
ECR_REPOSITORY: ${{ env.ECR_REPOSITORY }} | |
run: | | |
cd driver-did-iden3 && \ | |
docker buildx build --push \ | |
--platform linux/amd64,linux/arm64 \ | |
-t ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ github.ref_name }} . |