Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cicd: add pypi release and docker push #44

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CD

on:
release:
types: [published]

jobs:
Release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: 3.9

- name: Install dependencies
run: pdm install

- name: Build and publish Python package
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
pdm build
pdm publish --username __token__ --password $PYPI_API_TOKEN

- 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.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# - name: Build and push Jupyter Spark image
# uses: docker/build-push-action@v5
# with:
# context: .
# file: docker/Dockerfile-jupyter-spark
# platforms: linux/amd64
# push: true
# tags: |
# weygu/pyspark-notebook-nebulagraph:${{ github.event.release.tag_name }}
# weygu/pyspark-notebook-nebulagraph:latest

- name: Build and push Jupyter NetworkX image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile-jupyter-networkx
platforms: linux/amd64,linux/arm64
push: true
tags: |
weygu/ngai-jupyter-networkx:${{ github.event.release.tag_name }}
weygu/ngai-jupyter-networkx:latest
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

name: Tests
name: CI

on:
pull_request:
Expand Down Expand Up @@ -34,4 +33,4 @@ jobs:
- name: Run Unit Tests
run: pdm run test
- name: Run Integration Tests
run: pdm run int-test
run: pdm run int-test
2 changes: 1 addition & 1 deletion docker/Dockerfile-jupyter-networkx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM jupyter/minimal-notebook:python-3.9.13

RUN pip install ng_ai[networkx] && \
pip install ipython-ngql && \
pip install jupyter_nebulagraph && \
pip install pyvis && \
rm -rf /home/$NB_USER/.cache/pip

Expand Down