Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1383 from a76yyyy/patch-2
Browse files Browse the repository at this point in the history
Auto build Docker images when releasing new
  • Loading branch information
Binaryify authored Oct 28, 2021
2 parents 9fe5238 + ac02283 commit 6c37439
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/Build_Image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Image

on:
push:
tags:
- v*

jobs:
build:
if: github.event.base_ref == 'refs/heads/master'
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/ppc64le,linux/s390x,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
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ WORKDIR /app
COPY . /app

RUN npm config set registry "https://registry.npm.taobao.org/" \
&& npm install -g npm husky \
&& npm install --production

EXPOSE 3000
Expand Down

2 comments on commit 6c37439

@vercel
Copy link

@vercel vercel bot commented on 6c37439 Oct 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 6c37439 Oct 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

netease-cloud-music-api – ./docs

netease-cloud-music-api-git-master-binaryify.vercel.app
neteasecloudmusicapi.vercel.app

Please sign in to comment.