File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -23,18 +23,39 @@ jobs:
23
23
matrix :
24
24
packages : ${{ fromJson(inputs.packages_deployment) }}
25
25
26
+ outputs :
27
+ DOCKERFILE_EXISTS : ${{ steps.check-dockerfile.outputs.DOCKERFILE_EXISTS }}
28
+
26
29
steps :
27
30
- name : checkout
31
+ uses : action/checkout
32
+
33
+ - name : Check if Dockerfile exists
34
+ id : check-dockerfile
35
+ run : |
36
+ if [ ! -f apps/${{ matrix.packages.name }}/Dockerfile ]; then
37
+ echo "Dockerfile does not exist"
38
+ echo "DOCKERFILE_EXISTS=false" >> $GITHUB_OUTPUT
39
+ else
40
+ echo "Dockerfile exists"
41
+ echo "DOCKERFILE_EXISTS=true" >> $GITHUB_OUTPUT
42
+ fi
43
+
44
+ - name : checkout
45
+ if : steps.check-dockerfile.outputs.DOCKERFILE_EXISTS == 'true'
28
46
uses : actions/checkout@v3
29
47
with :
30
48
repository : stamford-syntax-club/infra
31
49
fetch-depth : 0
32
50
token : ${{ secrets.workflow_token }}
33
51
34
52
- name : create and checkout new branch
53
+ if : steps.check-dockerfile.outputs.DOCKERFILE_EXISTS == 'true'
35
54
run : |
36
55
git checkout -b deploy/${{ inputs.environment }}/coursecompose/${{ matrix.packages.name }}/${{ github.sha }}
56
+
37
57
- name : change image tag
58
+ if : steps.check-dockerfile.outputs.DOCKERFILE_EXISTS == 'true'
38
59
run : |
39
60
git config user.name "${{ github.actor }}"
40
61
git config user.email "${{ github.actor }}@stamford.dev"
You can’t perform that action at this time.
0 commit comments