Skip to content

chore: minor improvement #21

chore: minor improvement

chore: minor improvement #21

Workflow file for this run

name: build
on:
workflow_dispatch:
inputs:
branch:
type: choice
options:
- dev
- master
default: "dev"
required: true
push:
branches:
- dev
env:
platform: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
defaults:
run:
shell: bash
working-directory: ./
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch || github.ref_name }}
- uses: mikefarah/yq@master
id: get_version
with:
cmd: "yq -p toml -oy '.project.version' pyproject.toml"
- name: Build and push (master)
uses: docker/build-push-action@v6
if: ${{ inputs.branch == 'master' || github.ref_name == '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' || github.ref_name == 'dev' }}
with:
push: true
context: .
platforms: ${{ env.platform }}
tags: ${{ secrets.DOCKER_USER }}/genpac:dev