-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 1.62 KB
/
matrix-deploy.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
name: Multi stage build & deploy
on:
workflow_dispatch:
push:
branches: [ "main", "Development" ]
paths:
- "src/**"
- ".github/workflows/matrix-deploy.yml"
jobs:
set-env:
runs-on: ubuntu-latest
name: Set Environment (Matrix Deploy)
outputs:
branch: ${{ steps.var.outputs.branch }}
checked-out-sha: ${{ steps.var.outputs.checked-out-sha }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- id: var
run: |
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
CHECKED_OUT_SHA="$(git log -1 '--format=format:%H')"
echo "branch=$GIT_BRANCH" >> $GITHUB_OUTPUT
echo "checked-out-sha=${CHECKED_OUT_SHA}" >> $GITHUB_OUTPUT
create-and-publish-image:
needs: set-env
name: Create & Publish Image
uses: ./.github/workflows/build-image.yml
secrets: inherit
with:
branch: ${{ needs.set-env.outputs.branch }}
checked-out-sha: ${{ needs.set-env.outputs.checked-out-sha }}
create-and-tag-release:
needs: [ set-env, create-and-publish-image ]
name: Create & Tag Release
uses: ./.github/workflows/create-tag-release.yml
secrets: inherit
deploy-to-dev:
needs: [ set-env, create-and-publish-image ]
name: Deployment to Dev & Test
strategy:
max-parallel: 1
fail-fast: true
matrix:
target: [ Dev ]
uses: ./.github/workflows/deploy-image.yml
with:
environment: ${{ matrix.target }}
branch: ${{ needs.set-env.outputs.branch }}
checked-out-sha: ${{ needs.set-env.outputs.checked-out-sha }}
secrets: inherit