ci: Update image tag for GitHub Actions in ci.yml

- Change image tags to use SHORT_SHA instead of github.sha in .github/workflows/ci.yml
This commit is contained in:
Laisky.Cai 2023-11-17 02:04:03 +00:00
parent 75e1a27772
commit 91d5003c61

View File

@ -46,6 +46,9 @@ jobs:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
-
name: Build and push latest
uses: docker/build-push-action@v4
@ -59,4 +62,4 @@ jobs:
with:
context: .
push: true
tags: ppcelery/one-api:${{ github.sha }}
tags: ppcelery/one-api:${SHORT_SHA}