build: 更新 action

This commit is contained in:
BugKing 2020-12-03 19:18:08 +08:00
parent 0cd9fb7680
commit 9e6de725eb
1 changed files with 11 additions and 3 deletions

View File

@ -1,7 +1,14 @@
name: Build Docker Image and Push name: Build Docker Image and Push
on: on:
workflow_dispatch: push:
branches:
- main
- v1*
pull_request:
branches:
- main
- v1*
jobs: jobs:
build_push: build_push:
@ -9,7 +16,8 @@ jobs:
name: Build Docker Image and Push name: Build Docker Image and Push
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: nelonoel/branch-name@v1.0.1 - name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
- name: Cache node modules - name: Cache node modules
uses: actions/cache@v2 uses: actions/cache@v2
env: env:
@ -47,4 +55,4 @@ jobs:
password: ${{ secrets.DOCKER_HUB_TOKEN }} password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: metersphere/metersphere repository: metersphere/metersphere
tag_with_ref: true tag_with_ref: true
tag_with_sha: true build_args: MS_VERSION=${{ env.GITHUB_REF_SLUG }}-${{ env.GITHUB_SHA_SHORT }}