Skip to content

Commit

Permalink
perf(action): use docker build-push-action
Browse files Browse the repository at this point in the history
  • Loading branch information
JinnLynn committed Jul 2, 2024
1 parent a390426 commit 1176419
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,21 @@ jobs:
id: get_version
with:
cmd: "yq -p toml -oy '.project.version' pyproject.toml"
- if: ${{ inputs.branch == 'master' }}
name: Build Docker From master
run: |
docker buildx build --push --platform "${{ env.platform }}" \
-t ${{ secrets.DOCKER_USER }}/genpac \
-t ${{ secrets.DOCKER_USER }}/genpac:${{steps.get_version.outputs.result}} \
.
- if: ${{ inputs.branch == 'dev' }}
name: Build Docker From dev
run: |
docker buildx build --push --platform "${{ env.platform }}" \
-t ${{ secrets.DOCKER_USER }}/genpac:dev .
- name: Build and push (master)
uses: docker/build-push-action@v6
if: ${{ inputs.branch == 'master' }}
with:
push: true
context: .
platforms: ${{ env.platform }}
tags: |
${{ secrets.DOCKER_USER }}/genpac
${{ secrets.DOCKER_USER }}/genpac:${{steps.get_version.outputs.result}}
- name: Build and push (dev)
uses: docker/build-push-action@v6
if: ${{ inputs.branch == 'dev' }}
with:
push: true
context: .
platforms: ${{ env.platform }}
tags: ${{ secrets.DOCKER_USER }}/genpac:dev

0 comments on commit 1176419

Please sign in to comment.