-
Notifications
You must be signed in to change notification settings - Fork 170
151 lines (136 loc) · 5.56 KB
/
ci-cd-pipeline.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: CI/CD
on:
push:
branches: [main, wojciechos/cleanup-ci]
tags: [v*]
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Define docker image tag
run: echo "DOCKER_IMAGE_TAG=$(git describe --tags)" >> $GITHUB_ENV
outputs:
DOCKER_IMAGE_TAG: ${{ env.DOCKER_IMAGE_TAG }}
docker_build_and_publish_amd:
needs: [setup]
uses: ./.github/workflows/docker-build-publish-amd.yml
with:
tag: ${{ needs.setup.outputs.DOCKER_IMAGE_TAG }}
deploy_to_dev:
needs: [docker_build_and_publish_amd]
runs-on: ubuntu-latest
environment:
name: Development
steps:
- name: Repository Dispatch Dev
env:
EVENT_NAME: juno-dev
IMAGE_TAG: ${{ needs.setup.outputs.DOCKER_IMAGE_TAG }}
GOERLI: apps/juno-dev/overlays/dev-goerli-1/config.yaml
INTEGRATION: apps/juno-dev/overlays/dev-integration/config.yaml
MAINNET: apps/juno-dev/overlays/dev-mainnet/config.yaml
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/NethermindEth/argo/dispatches \
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "goerli_config": "${{ env.GOERLI }}", "integration_config": "${{ env.INTEGRATION }}", "mainnet_config": "${{ env.MAINNET }}", "tag": "${{ env.IMAGE_TAG }}"}}'
dev-starknet-rs-tests:
needs: [deploy_to_dev]
uses: ./.github/workflows/starknet-rs-tests.yml
secrets:
STARKNET_RPC: "${{ secrets.DEV_GOERLI_URL }}/v0_4"
dev-rpc-tests:
needs: [deploy_to_dev]
uses: ./.github/workflows/rpc-tests.yml
secrets:
STARKNET_RPC: "${{ secrets.DEV_MAINNET_URL }}/v0_4"
REPOSITORY_DISPATCH_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}
dev-load-tests:
needs: [deploy_to_dev]
uses: ./.github/workflows/load-tests.yml
with:
VUS: '2'
DURATION: '300s'
secrets:
NODE_URL: "${{ secrets.DEV_MAINNET_URL }}/v0_4"
REPOSITORY_DISPATCH_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}
deploy_to_staging:
needs: [docker_build_and_publish_amd, deploy_to_dev]
runs-on: ubuntu-latest
environment:
name: Staging
steps:
- name: Repository Dispatch Staging
env:
EVENT_NAME: juno-staging
IMAGE_TAG: ${{ needs.setup.outputs.DOCKER_IMAGE_TAG }}
GOERLI: apps/juno-staging/overlays/staging-goerli-1/config.yaml
INTEGRATION: apps/juno-staging/overlays/staging-integration/config.yaml
MAINNET: apps/juno-staging/overlays/staging-mainnet/config.yaml
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/NethermindEth/argo/dispatches \
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "goerli_config": "${{ env.GOERLI }}", "integration_config": "${{ env.INTEGRATION }}", "mainnet_config": "${{ env.MAINNET }}", "tag": "${{ env.IMAGE_TAG }}"}}'
staging-starknet-rs-tests:
needs: [deploy_to_staging]
uses: ./.github/workflows/starknet-rs-tests.yml
secrets:
STARKNET_RPC: "${{ secrets.STAGING_GOERLI_URL }}/v0_4"
staging-rpc-tests:
needs: [deploy_to_staging]
uses: ./.github/workflows/rpc-tests.yml
secrets:
STARKNET_RPC: "${{ secrets.STAGING_MAINNET_URL }}/v0_4"
REPOSITORY_DISPATCH_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}
staging-load-tests:
needs: [deploy_to_staging]
uses: ./.github/workflows/load-tests.yml
with:
VUS: '2'
DURATION: '300s'
secrets:
NODE_URL: "${{ secrets.STAGING_MAINNET_URL }}/v0_4"
REPOSITORY_DISPATCH_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}
deploy_to_production:
needs: [docker_build_and_publish_amd, deploy_to_staging]
runs-on: ubuntu-latest
environment:
name: Production
steps:
- name: Repository Dispatch Prod
env:
EVENT_NAME: juno-prod
IMAGE_TAG: ${{ needs.setup.outputs.DOCKER_IMAGE_TAG }}
GOERLI: apps/juno-prod/overlays/prod_goerli-1/config.yaml
INTEGRATION: apps/juno-prod/overlays/prod_integration/config.yaml
MAINNET: apps/juno-prod/overlays/prod_mainnet/config.yaml
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/NethermindEth/argo/dispatches \
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "goerli_config": "${{ env.GOERLI }}", "integration_config": "${{ env.INTEGRATION }}", "mainnet_config": "${{ env.MAINNET }}", "tag": "${{ env.IMAGE_TAG }}"}}'
prod-starknet-rs-tests:
needs: [deploy_to_production]
uses: ./.github/workflows/starknet-rs-tests.yml
secrets:
STARKNET_RPC: "${{ secrets.PROD_GOERLI_URL }}/v0_4"
prod-rpc-tests:
needs: [deploy_to_production]
uses: ./.github/workflows/rpc-tests.yml
secrets:
STARKNET_RPC: "${{ secrets.PROD_MAINNET_URL }}/v0_4"
REPOSITORY_DISPATCH_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}