Skip to content

Feat/integrate non inclusion #16

Feat/integrate non inclusion

Feat/integrate non inclusion #16

Workflow file for this run

name: Build, Push Docker Image, and Deploy Python Package
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Log in to Docker Hub
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create remote builder certificates
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
echo "${{ secrets.BUILDKIT_CA_PEM }}" > ${{ github.workspace }}/client-ca.pem
echo "${{ secrets.BUILDKIT_CERT_PEM }}" > ${{ github.workspace }}/client-cert.pem
echo "${{ secrets.BUILDKIT_KEY_PEM }}" > ${{ github.workspace }}/client-key.pem
- name: Set up Docker Buildx
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/setup-buildx-action@v3
with:
driver: remote
endpoint: "tcp://buildkit.herodotus.dev:5000"
driver-opts: |
cacert=${{ github.workspace }}/client-ca.pem
cert=${{ github.workspace }}/client-cert.pem
key=${{ github.workspace }}/client-key.pem
cleanup: true
- name: Build and push Docker image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
file: environment.dockerfile
tags: "dataprocessor/hdp-cairo:latest"
platforms: linux/amd64,linux/arm64
push: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build Python package
run: |
python setup.py sdist bdist_wheel
- name: Check PyPI package (dry run)
run: |
twine check dist/*
echo "Package check completed. In a real publish, the package would be uploaded to PyPI."
- name: Publish package to PyPI
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}