Skip to content

Commit

Permalink
feat: build
Browse files Browse the repository at this point in the history
  • Loading branch information
JinnLynn committed Jun 12, 2024
1 parent 0e8215a commit 9ecaf55
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 41 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/build-dev.yml

This file was deleted.

26 changes: 19 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
name: build
on:
workflow_dispatch:
push:
branches:
- master
inputs:
branch:
type: choice
options:
- dev
- master
default: dev
env:
platform: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
defaults:
run:
shell: bash
working-directory: ./
jobs:
cook:
uses: ./.github/workflows/cook.yml
# cook:
# uses: ./.github/workflows/cook.yml
docker:
needs: cook
# needs: cook
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
Expand All @@ -27,13 +31,21 @@ jobs:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- uses: mikefarah/yq@master
id: get_version
with:
cmd: yq -p toml -oy '.project.version' pyproject.toml
- name: Build Docker
- if: ${{ inputs.branch == 'master' }}
name: Build Docker From master
run: |
echo 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: |
echo docker buildx build --push --platform "${{ env.platform }}" \
-t ${{ secrets.DOCKER_USER }}/genpac:dev .

0 comments on commit 9ecaf55

Please sign in to comment.