mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-10-26 14:42:59 +08:00
优化github build
This commit is contained in:
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
@@ -6,9 +6,12 @@ on:
|
|||||||
- main
|
- main
|
||||||
- dev
|
- dev
|
||||||
- 'feat/**'
|
- 'feat/**'
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_FQDN: registry.cn-hangzhou.aliyuncs.com/playedu/api
|
IMAGE_FQDN: registry.cn-hangzhou.aliyuncs.com/playedu/api
|
||||||
|
IMAGE_TAG: ''
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
@@ -33,4 +36,16 @@ jobs:
|
|||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.IMAGE_FQDN }}:1.4
|
${{ env.IMAGE_FQDN }}:${{ env.IMAGE_TAG }}
|
||||||
|
env:
|
||||||
|
IMAGE_TAG: ${{ startsWith(github.ref, 'refs/heads/main') && 'latest' || startsWith(github.ref, 'refs/heads/dev') && 'dev' || github.ref_slug }}
|
||||||
|
if: startsWith(github.ref, 'refs/heads/')
|
||||||
|
- name: Build with Tag
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.IMAGE_FQDN }}:${{ github.ref }}
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
|||||||
Reference in New Issue
Block a user