File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change 1
- name : CI
2
- on : [push]
1
+ name : Build and push image
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - " v*"
3
7
4
8
jobs :
5
9
build-and-push-image :
@@ -14,10 +18,14 @@ jobs:
14
18
registry : ghcr.io
15
19
username : ${{ github.actor }}
16
20
password : ${{ secrets.GITHUB_TOKEN }}
17
- - name : Build and push image
18
- run : |
19
- IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
20
- IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
21
- echo $IMAGE_ID
22
- docker build . -t ${IMAGE_ID}
23
- docker push ${IMAGE_ID}:latest
21
+ - name : Extract version
22
+ run : echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
23
+ - name : Print version
24
+ run : echo $VERSION
25
+ # - name: Build and push image
26
+ # run: |
27
+ # IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
28
+ # IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
29
+ # echo $IMAGE_ID
30
+ # docker build . -t ${IMAGE_ID}
31
+ # docker push ${IMAGE_ID}:latest
You can’t perform that action at this time.
0 commit comments