mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-05-23 22:37:41 +08:00
Auto build Docker images when releasing new
在setting创建secrets name=DOCKER_USERNAME value=Docker_ID; 创建secrets name=DOCKER_PASSWORD value=Docker_Password; 实现在发布新版本tag时自动构建Docker镜像
This commit is contained in:
parent
9fe5238ab8
commit
42a64dc0e1
28
.github/workflows/Build_Image.yml
vendored
Normal file
28
.github/workflows/Build_Image.yml
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
name: Build Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
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, 'Binaryify/NeteaseCloudMusicApi')
|
||||||
|
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, 'Binaryify/NeteaseCloudMusicApi')
|
||||||
|
with:
|
||||||
|
publish: true
|
||||||
|
imageName: binaryify/netease_cloud_music_api # 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…
x
Reference in New Issue
Block a user