mirror of
https://gitee.com/novel_dev_team/novel-plus
synced 2026-07-20 17:54:59 +08:00
ci: 自动上传 Docker 镜像
This commit is contained in:
53
.github/workflows/release.yml
vendored
53
.github/workflows/release.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
||||
with:
|
||||
# 使用 tag_name 而不是 github.ref
|
||||
tag_name: ${{ github.ref_name }}
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
- name: Upload sql.zip
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ${{ github.workspace }}/novel-common/target/build/sql.zip
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
- name: Upload novel-crawl.zip
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ${{ github.workspace }}/novel-crawl/target/build/novel-crawl.zip
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
- name: Upload novel-front.zip
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ${{ github.workspace }}/novel-front/target/build/novel-front.zip
|
||||
@@ -71,9 +71,50 @@ jobs:
|
||||
- name: Upload novel-admin.zip
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ${{ github.workspace }}/novel-admin/target/build/novel-admin.zip
|
||||
asset_name: novel-admin.zip
|
||||
asset_content_type: application/zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
|
||||
# 登录 Docker Hub
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
# 构建并推送 novel-front 镜像
|
||||
- name: Build and Push novel-front Docker Image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./novel-front/target/build
|
||||
file: ./novel-front/target/build/Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/novel-front:latest
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/novel-front:${{ github.ref_name }}
|
||||
|
||||
# 构建并推送 novel-admin 镜像
|
||||
- name: Build and Push novel-admin Docker Image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./novel-admin/target/build
|
||||
file: ./novel-admin/target/build/Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/novel-admin:latest
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/novel-admin:${{ github.ref_name }}
|
||||
|
||||
# 构建并推送 novel-crawl 镜像
|
||||
- name: Build and Push novel-crawl Docker Image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./novel-crawl/target/build
|
||||
file: ./novel-crawl/target/build/Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/novel-crawl:latest
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/novel-crawl:${{ github.ref_name }}
|
||||
|
||||
Reference in New Issue
Block a user