ci(docker): add version tag to every deployment

This commit is contained in:
ElyPrism 2025-10-05 20:58:39 +08:00 committed by GitHub
parent a76576af23
commit ba16f2f0ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,6 +14,11 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
# 读取 package.json 的版本号
- name: Read package version
id: pkg
run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV
- name: Log in to Docker Hub - name: Log in to Docker Hub
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
@ -27,5 +32,5 @@ jobs:
push: true push: true
tags: | tags: |
moefurina/ncm-api:latest moefurina/ncm-api:latest
moefurina/ncm-api:${{ github.sha }} moefurina/ncm-api:${{ env.VERSION }}
platforms: linux/amd64 platforms: linux/amd64