更新npm包
Build and publish Docker images / Test, build and publish (push) Successful in 13m51s

This commit is contained in:
2026-07-21 11:40:16 +08:00 Unverified
parent cb7797ff99
commit e95f553174
4 changed files with 54 additions and 24 deletions
+29 -2
View File
@@ -1,4 +1,4 @@
name: Build and publish Docker image
name: Build and publish Docker images
on:
push:
@@ -10,6 +10,9 @@ jobs:
publish:
name: Test, build and publish
runs-on: ubuntu-latest
permissions:
contents: read
releases: write
steps:
- name: Check out repository
@@ -39,11 +42,20 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to Gitea Container Registry
uses: https://github.com/docker/login-action@v3
with:
registry: git.biss.click
username: ${{ vars.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Generate image tags and labels
id: metadata
uses: https://github.com/docker/metadata-action@v5
with:
images: docker.io/${{ vars.DOCKERHUB_IMAGE }}
images: |
docker.io/${{ vars.DOCKERHUB_IMAGE }}
git.biss.click/biss/exam-information-system
flavor: latest=false
tags: |
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/master' }}
@@ -62,3 +74,18 @@ jobs:
labels: ${{ steps.metadata.outputs.labels }}
cache-from: type=registry,ref=docker.io/${{ vars.DOCKERHUB_IMAGE }}:buildcache
cache-to: type=registry,ref=docker.io/${{ vars.DOCKERHUB_IMAGE }}:buildcache,mode=max
- name: Create Gitea release
if: gitea.ref_type == 'tag'
uses: https://gitea.com/actions/gitea-release-action@v1
with:
token: ${{ secrets.GITEA_TOKEN }}
tag_name: ${{ gitea.ref_name }}
name: ${{ gitea.ref_name }}
body: |
Docker 镜像已发布:
```text
docker pull docker.io/${{ vars.DOCKERHUB_IMAGE }}:${{ steps.metadata.outputs.version }}
docker pull git.biss.click/biss/exam-information-system:${{ steps.metadata.outputs.version }}
```