-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (82 loc) · 4.16 KB
/
publis-container-dev.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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 }} .