File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and push image
2
+
3
+ on :
4
+ release :
5
+ types : [created]
6
+
7
+ jobs :
8
+ build-and-push-image :
9
+ runs-on : ubuntu-latest
10
+ env :
11
+ IMAGE_NAME : " oc4ids-datastore-api"
12
+ steps :
13
+ - uses : actions/checkout@v4
14
+ - name : Login to GitHub Container Registry
15
+ uses : docker/login-action@v3
16
+ with :
17
+ registry : ghcr.io
18
+ username : ${{ github.actor }}
19
+ password : ${{ secrets.GITHUB_TOKEN }}
20
+ - name : Extract version
21
+ run : |
22
+ TAG=${GITHUB_REF#refs/*/}
23
+ echo "VERSION=${TAG#v}" >> $GITHUB_ENV
24
+ - name : Print version
25
+ run : echo $VERSION
26
+ - name : Build and push image
27
+ run : |
28
+ IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
29
+ IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
30
+ echo $IMAGE_ID
31
+ docker build . -t ${IMAGE_ID}:${VERSION} -t ${IMAGE_ID}:latest
32
+ docker push --all-tags ${IMAGE_ID}
You can’t perform that action at this time.
0 commit comments