-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (68 loc) · 2.51 KB
/
merge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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 }}