Skip to content

Commit f4a58ee

Browse files
committed
concising workflows
1 parent 720d68c commit f4a58ee

3 files changed

Lines changed: 18 additions & 38 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,13 @@ on:
55
branches: [ "main" ]
66

77
jobs:
8-
deploy-on-vm1:
8+
deploy-on-vm:
99
runs-on: self-hosted
1010

11-
steps:
12-
- name: Check out repository code
13-
uses: actions/checkout@v4
14-
15-
- name: Execute deployment script
16-
env:
17-
PORT_FROM_SECRET: ${{ secrets.NODE_TCP_PORT }}
18-
run: |
19-
chmod +x deploy.sh
20-
./deploy.sh
21-
deploy-on-vm2:
22-
runs-on: self-hosted
11+
strategy:
12+
matrix:
13+
# creates two parallel runs of this job
14+
instance: [1, 2]
2315

2416
steps:
2517
- name: Check out repository code
@@ -31,3 +23,4 @@ jobs:
3123
run: |
3224
chmod +x deploy.sh
3325
./deploy.sh
26+

.github/workflows/maintenance.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,14 @@ on:
99
- cron: '0 3 * * 0'
1010

1111
jobs:
12-
cleanup-vm1:
12+
cleanup-vms:
1313
name: Run Cleanup Script on VM1
1414
runs-on: self-hosted
1515

16-
steps:
17-
- name: Check out repository
18-
uses: actions/checkout@v4
19-
20-
- name: Run Maintenance Script
21-
run: |
22-
chmod +x maintenance.sh
23-
./maintenance.sh
24-
cleanup-vm2:
25-
name: Run Cleanup Script on VM2
26-
runs-on: self-hosted
16+
strategy:
17+
matrix:
18+
# creates two parallel runs of this job
19+
instance: [1, 2]
2720

2821
steps:
2922
- name: Check out repository

.github/workflows/teardown.yaml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,15 @@ on:
55
workflow_dispatch:
66

77
jobs:
8-
destroy-on-vm1:
9-
name: Stop and Remove Services from VMs
10-
runs-on: self-hosted
11-
12-
steps:
13-
- name: Check out repository
14-
uses: actions/checkout@v4
15-
16-
- name: Run Destruction Script
17-
run: |
18-
chmod +x teardown.sh
19-
./teardown.sh
20-
destroy-on-vm2:
8+
destroy:
219
name: Stop and Remove Services from VMs
2210
runs-on: self-hosted
11+
12+
# use a matrix strategy to run the job multiple times
13+
strategy:
14+
matrix:
15+
# creates two parallel runs of this job
16+
instance: [1, 2]
2317

2418
steps:
2519
- name: Check out repository

0 commit comments

Comments
 (0)