File tree 1 file changed +10
-6
lines changed 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,19 @@ jobs:
42
42
43
43
- name : Set env
44
44
run : |
45
- echo "CI_SHA_SHORT=$CI_SHA_SHORT" >> $GITHUB_ENV
46
- echo "CI_ACTION_REF_NAME=$CI_ACTION_REF_NAME" >> $GITHUB_ENV
45
+ echo "APP_VERSION=$CI_SHA_SHORT" >> $GITHUB_ENV
46
+
47
+ - name : Set env when tag
48
+ if : startsWith(github.ref, 'refs/tags/')
49
+ run : |
50
+ echo "APP_VERSION=$CI_ACTION_REF_NAME" >> $GITHUB_ENV
47
51
48
52
- name : build
49
53
uses : docker://ecoding/php:8.0
50
54
env :
51
- CI_SHA_SHORT : ${{ env.CI_SHA_SHORT }}
55
+ APP_VERSION : ${{ env.APP_VERSION }}
52
56
with :
53
- args : php coding app:build --build-version=${{ env.CI_SHA_SHORT }}
57
+ args : php coding app:build --build-version=${{ env.APP_VERSION }}
54
58
55
59
- name : Upload Artifact
56
60
uses : actions/upload-artifact@v2
@@ -74,11 +78,11 @@ jobs:
74
78
if : startsWith(github.ref, 'refs/tags/')
75
79
uses : docker/build-push-action@v2
76
80
env :
77
- CI_ACTION_REF_NAME : ${{ env.CI_ACTION_REF_NAME }}
81
+ APP_VERSION : ${{ env.APP_VERSION }}
78
82
with :
79
83
push : true
80
84
context : .
81
- tags : ecoding/coding-cli:latest,ecoding/coding-cli:${{ env.CI_ACTION_REF_NAME }}
85
+ tags : ecoding/coding-cli:latest,ecoding/coding-cli:${{ env.APP_VERSION }}
82
86
83
87
- name : Image digest
84
88
if : steps.docker_build.conclusion == 'success'
You can’t perform that action at this time.
0 commit comments