Skip to content

Commit 449e378

Browse files
committed
Automatically get DB name
1 parent e725751 commit 449e378

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/_integration.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,25 @@ on:
66
CODECOV_TOKEN:
77
required: true
88

9+
10+
911
jobs:
12+
get-db-image:
13+
runs-on: ubuntu-latest
14+
env:
15+
BRANCH_NAME: ${{ github.ref_type == 'tag' && 'master' || (github.head_ref || github.ref_name) }}
16+
outputs:
17+
branch: ${{ steps.clean.outputs.branch }}
18+
steps:
19+
- id: clean
20+
name: "Clean branch name"
21+
run: echo "branch=${BRANCH_NAME//\//-}" >> "$GITHUB_OUTPUT"
1022
test:
1123
runs-on: ubuntu-latest
24+
needs: get-db-image
1225
services:
1326
integration-db:
14-
image: ghcr.io/diamondlightsource/pato-backend-db:${{ github.ref_type == 'tag' && 'master' || (github.head_ref || github.ref_name) }}
27+
image: ghcr.io/diamondlightsource/pato-backend-db:${{ needs.get-db-image.outputs.branch }}
1528
ports:
1629
- 3306:3306
1730
strategy:

0 commit comments

Comments
 (0)