Skip to content

Workflow file for this run

name: Upload Python Package and Build Image
on:
release:
types: [published]
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine hatch
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Upload dists to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
file_glob: true
tag: ${{ github.ref }}
overwrite: true
# Build docker images
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push image
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
build-args: |
BCC_VERSION=v0.28.0
DUETECTOR_VERSION=${{ github.ref_name }}
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/duetector:${{ github.ref_name }}
# Build latest if release
-
name: Build and push release
if: '!github.event.release.prerelease'
id: docker_build_release
uses: docker/build-push-action@v4
with:
context: .
build-args: |
BCC_VERSION=v0.28.0
DUETECTOR_VERSION=${{ github.ref_name }}
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/duetector:latest