Skip to content

Commit a53c049

Browse files
committed
Run cluster deployment on PRs
1 parent 9821f88 commit a53c049

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

.github/workflows/bare-metal-deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ on:
5151
jobs:
5252
deploy:
5353
runs-on: ${{ inputs.runs_on }}
54+
concurrency:
55+
group: ${{ inputs.cluster }}
5456

5557
outputs:
5658
cluster_id: ${{ steps.deployment.outputs.cluster_id }}

.github/workflows/integration-tests.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
name: Integration Tests
22

33
on:
4-
push:
5-
branches: [main]
64
pull_request:
7-
branches: [main]
8-
workflow_dispatch:
9-
5+
types: [ready_for_review, review_requested]
6+
107
jobs:
11-
integration-test:
8+
mock-deploy:
129
runs-on: ubuntu-latest
1310
services:
1411
docker:
@@ -34,3 +31,34 @@ jobs:
3431
run: |
3532
docker compose -f docker-compose-dev.yml logs
3633
docker compose -f docker-compose-dev.yml down --volumes --remove-orphans
34+
35+
await-image:
36+
name: Await docker image
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Wait for image to be built succeed
40+
uses: lewagon/wait-on-check-action@v1.3.4
41+
with:
42+
ref: ${{ github.head_ref || github.ref_name }}
43+
check-name: 'build'
44+
repo-token: ${{ secrets.GITHUB_TOKEN }}
45+
wait-interval: 10
46+
47+
deploy:
48+
needs: [await-image, mock-deploy]
49+
if: ${{ vars.ci_cluster != '' }}
50+
uses: ./.github/workflows/bare-metal-deploy.yml
51+
with:
52+
runs_on: self-hosted
53+
cluster: ${{ vars.ci_cluster }}
54+
docker_image: public.ecr.aws/simply-block/simplyblock:${{ github.head_ref || github.ref_name }}
55+
sbcli_source: ${{ github.repositoryUrl }}@${{ github.sha }}
56+
57+
test:
58+
needs: deploy
59+
uses: ./.github/workflows/api-test.yml
60+
with:
61+
runs_on: self-hosted
62+
cluster_id: ${{ needs.deploy.outputs.cluster_id }}
63+
cluster_ip: ${{ needs.deploy.outputs.cluster_ip }}
64+
cluster_secret: ${{ needs.deploy.outputs.cluster_secret }}

0 commit comments

Comments
 (0)