mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 11:42:44 +08:00
Merge pull request #565 from RockChinQ/docker-image-test
[CI] Docker 部署脚本同步
This commit is contained in:
commit
04dad9757f
29
.github/workflows/build_docker_image.yml
vendored
Normal file
29
.github/workflows/build_docker_image.yml
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
name: Build Image
|
||||
on:
|
||||
#防止fork乱用action设置只能手动触发构建
|
||||
workflow_dispatch:
|
||||
## 发布release的时候会自动构建
|
||||
release:
|
||||
types: [published]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
name: Build image job
|
||||
|
||||
steps:
|
||||
- name: Checkout master
|
||||
uses: actions/checkout@master
|
||||
- name: Get version
|
||||
id: get_version
|
||||
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.repository, 'RockChinQ/QChatGPT')
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
||||
- name: Build and publish image
|
||||
uses: ilteoood/docker_buildx@master
|
||||
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.repository, 'RockChinQ/QChatGPT')
|
||||
with:
|
||||
publish: true
|
||||
imageName: mikumifa/qchatgpt-docker # dockerid/imageName
|
||||
platform: linux/386,linux/arm64,linux/amd64,linux/arm/v6,linux/arm/v7 # 你准备构建的镜像平台
|
||||
tag: latest,${{ steps.get_version.outputs.VERSION }}
|
||||
dockerUser: ${{ secrets.DOCKER_USERNAME }} # docker hub userid 在setting创建secrets name=DOCKER_USERNAME value=dockerid
|
||||
dockerPassword: ${{ secrets.DOCKER_PASSWORD }} # docker hub password,在setting创建secrets name=DOCKER_PASSWORD value=dockerpassword
|
Loading…
Reference in New Issue
Block a user