Skip to content

Commit

Permalink
优化github build
Browse files Browse the repository at this point in the history
  • Loading branch information
xxx committed Nov 14, 2023
1 parent 9f27aaa commit 3ea0773
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 6,12 @@ on:
- main
- dev
- 'feat/**'
tags:
- '*'

env:
IMAGE_FQDN: registry.cn-hangzhou.aliyuncs.com/playedu/api
IMAGE_TAG: ''

jobs:
build-and-push:
Expand All @@ -33,4 36,16 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
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/')

0 comments on commit 3ea0773

Please sign in to comment.