Skip to content

Commit 2ea6f34

Browse files
author
Ludo Galabru
authored
Merge pull request #240 from hirosystems/develop
BREAKING CHANGE: implement Jubilee support
2 parents bb68f65 + 9458956 commit 2ea6f34

29 files changed

+36263
-1096
lines changed

.github/workflows/ci.yaml

+34-22
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ on:
66
- develop
77
- feat/ordhook-sdk-js
88
paths-ignore:
9-
- '**/CHANGELOG.md'
9+
- "**/CHANGELOG.md"
1010
pull_request:
1111
workflow_dispatch:
1212

1313
concurrency:
1414
group: ${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}
1515
cancel-in-progress: true
1616

17+
env:
18+
DOCKER_IMAGE: hirosystems/${{ github.event.repository.name }}
19+
1720
jobs:
1821
test:
1922
runs-on: ubuntu-latest
@@ -41,7 +44,7 @@ jobs:
4144
- name: Upload coverage reports to Codecov
4245
uses: codecov/codecov-action@v3
4346
env:
44-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
47+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4548

4649
build-publish:
4750
runs-on: ubuntu-latest
@@ -84,7 +87,7 @@ jobs:
8487
uses: docker/metadata-action@v5
8588
with:
8689
images: |
87-
hirosystems/${{ github.event.repository.name }}
90+
${{ env.DOCKER_IMAGE }}
8891
tags: |
8992
type=ref,event=branch
9093
type=ref,event=pr
@@ -115,13 +118,14 @@ jobs:
115118
runs-on: ubuntu-latest
116119
strategy:
117120
matrix:
118-
k8s-env: [mainnet]
121+
network: [mainnet]
122+
subenv: [blue]
119123
needs: build-publish
120124
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
121125
env:
122126
DEPLOY_ENV: dev
123127
environment:
124-
name: Development-${{ matrix.k8s-env }}
128+
name: Development-${{ matrix.network }}-${{ matrix.subenv }}
125129
url: https://platform.dev.hiro.so/
126130
steps:
127131
- name: Checkout actions repo
@@ -131,11 +135,13 @@ jobs:
131135
token: ${{ secrets.GH_TOKEN }}
132136
repository: ${{ secrets.DEVOPS_ACTIONS_REPO }}
133137

134-
- name: Deploy Ordhook build to Dev ${{ matrix.k8s-env }}
138+
- name: Deploy Ordhook build to Dev ${{ matrix.network }} ${{ matrix.subenv }}
135139
uses: ./actions/deploy
136140
with:
137-
docker_tag: ${{ needs.build-publish.outputs.docker_image_digest }}
138-
file_pattern: manifests/bitcoin/${{ matrix.k8s-env }}/ordhook/${{ env.DEPLOY_ENV }}/base/kustomization.yaml
141+
docker_image: ${{ env.DOCKER_IMAGE }}
142+
docker_image_tag_or_digest: ${{ needs.build-publish.outputs.docker_image_digest }}
143+
file_pattern: manifests/bitcoin/${{ matrix.network }}/ordhook/${{ env.DEPLOY_ENV }}/*/kustomization.yaml
144+
subenv: ${{ matrix.subenv }}
139145
gh_token: ${{ secrets.GH_TOKEN }}
140146

141147
auto-approve-dev:
@@ -146,24 +152,25 @@ jobs:
146152
- name: Approve pending deployments
147153
run: |
148154
sleep 5
149-
ENV_IDS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/hirosystems/ordhook/actions/runs/${{ github.run_id }}/pending_deployments" | jq -r '[.[].environment.id // empty]')
155+
ENV_ID=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/hirosystems/ordhook/actions/runs/${{ github.run_id }}/pending_deployments" | jq -r '.[0].environment.id // empty')
150156
if [[ "${ENV_IDS}" != "[]" ]]; then
151-
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/hirosystems/ordhook/actions/runs/${{ github.run_id }}/pending_deployments" -d "{\"environment_ids\":${ENV_IDS},\"state\":\"approved\",\"comment\":\"auto approve\"}"
157+
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/hirosystems/ordhook/actions/runs/${{ github.run_id }}/pending_deployments" -d "{\"environment_ids\":[${ENV_ID}],\"state\":\"approved\",\"comment\":\"auto approve\"}"
152158
fi
153159
154160
deploy-staging:
155161
runs-on: ubuntu-latest
156162
strategy:
157163
matrix:
158-
k8s-env: [mainnet]
164+
network: [mainnet]
165+
subenv: [blue]
159166
needs:
160167
- build-publish
161168
- deploy-dev
162169
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
163170
env:
164171
DEPLOY_ENV: stg
165172
environment:
166-
name: Staging-${{ matrix.k8s-env }}
173+
name: Staging-${{ matrix.network }}-${{ matrix.subenv }}
167174
url: https://platform.stg.hiro.so/
168175
steps:
169176
- name: Checkout actions repo
@@ -173,11 +180,13 @@ jobs:
173180
token: ${{ secrets.GH_TOKEN }}
174181
repository: ${{ secrets.DEVOPS_ACTIONS_REPO }}
175182

176-
- name: Deploy Chainhook build to Stg ${{ matrix.k8s-env }}
183+
- name: Deploy Ordhook build to Stg ${{ matrix.network }} ${{ matrix.subenv }}
177184
uses: ./actions/deploy
178185
with:
179-
docker_tag: ${{ needs.build-publish.outputs.docker_image_digest }}
180-
file_pattern: manifests/bitcoin/${{ matrix.k8s-env }}/ordhook/${{ env.DEPLOY_ENV }}/base/kustomization.yaml
186+
docker_image: ${{ env.DOCKER_IMAGE }}
187+
docker_image_tag_or_digest: ${{ needs.build-publish.outputs.docker_image_digest }}
188+
file_pattern: manifests/bitcoin/${{ matrix.network }}/ordhook/${{ env.DEPLOY_ENV }}/*/kustomization.yaml
189+
subenv: ${{ matrix.subenv }}
181190
gh_token: ${{ secrets.GH_TOKEN }}
182191

183192
auto-approve-stg:
@@ -190,24 +199,25 @@ jobs:
190199
- name: Approve pending deployments
191200
run: |
192201
sleep 5
193-
ENV_IDS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/hirosystems/ordhook/actions/runs/${{ github.run_id }}/pending_deployments" | jq -r '[.[].environment.id // empty]')
202+
ENV_ID=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/hirosystems/ordhook/actions/runs/${{ github.run_id }}/pending_deployments" | jq -r '.[0].environment.id // empty')
194203
if [[ "${ENV_IDS}" != "[]" ]]; then
195-
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/hirosystems/ordhook/actions/runs/${{ github.run_id }}/pending_deployments" -d "{\"environment_ids\":${ENV_IDS},\"state\":\"approved\",\"comment\":\"auto approve\"}"
204+
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/hirosystems/ordhook/actions/runs/${{ github.run_id }}/pending_deployments" -d "{\"environment_ids\":[${ENV_ID}],\"state\":\"approved\",\"comment\":\"auto approve\"}"
196205
fi
197206
198207
deploy-prod:
199208
runs-on: ubuntu-latest
200209
strategy:
201210
matrix:
202-
k8s-env: [mainnet,testnet]
211+
network: [mainnet]
212+
subenv: [blue, green]
203213
needs:
204214
- build-publish
205215
- deploy-staging
206216
if: needs.build-publish.outputs.new_release_published == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
207217
env:
208218
DEPLOY_ENV: prd
209219
environment:
210-
name: Production-${{ matrix.k8s-env }}
220+
name: Production-${{ matrix.network }}-${{ matrix.subenv }}
211221
url: https://platform.hiro.so/
212222
steps:
213223
- name: Checkout actions repo
@@ -217,9 +227,11 @@ jobs:
217227
token: ${{ secrets.GH_TOKEN }}
218228
repository: ${{ secrets.DEVOPS_ACTIONS_REPO }}
219229

220-
- name: Deploy Ordhook build to Prd ${{ matrix.k8s-env }}
230+
- name: Deploy Ordhook build to Prd ${{ matrix.network }} ${{ matrix.subenv }}
221231
uses: ./actions/deploy
222232
with:
223-
docker_tag: ${{ needs.build-publish.outputs.docker_image_digest }}
224-
file_pattern: manifests/bitcoin/${{ matrix.k8s-env }}/ordhook/${{ env.DEPLOY_ENV }}/base/kustomization.yaml
233+
docker_image: ${{ env.DOCKER_IMAGE }}
234+
docker_image_tag_or_digest: ${{ needs.build-publish.outputs.docker_image_digest }}
235+
file_pattern: manifests/bitcoin/${{ matrix.network }}/ordhook/${{ env.DEPLOY_ENV }}/*/kustomization.yaml
236+
subenv: ${{ matrix.subenv }}
225237
gh_token: ${{ secrets.GH_TOKEN }}

0 commit comments

Comments
 (0)