Skip to content

Merge pull request #5 from catalystneuro/common-structure #20

Merge pull request #5 from catalystneuro/common-structure

Merge pull request #5 from catalystneuro/common-structure #20

name: Build and Push Docker Images
on:
push:
branches:
- main
paths:
- '*/**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
app_dir:
- si_kilosort25
- si_kilosort3
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Builder
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# username: YOUR_GITHUB_USERNAME # Replace with your GitHub username
# password: ${{ secrets.GHCR_PAT }} # Use the PAT secret
- name: Pip install dendro
run: |
python -m pip install --upgrade pip
git clone https://github.com/flatironinstitute/dendro.git
cd dendro/python
git pull
pip install .
- name: Generate Spec File and Build Docker Image
# if: contains(github.event.head_commit.modified, matrix.app_dir)
run: |
cd ${{ matrix.app_dir }}
chmod +x main.py
dendro make-app-spec-file --app-dir . --spec-output-file spec.json
docker build -t ghcr.io/catalystneuro/dendro_${{ matrix.app_dir }}:latest .
docker push ghcr.io/catalystneuro/dendro_${{ matrix.app_dir }}:latest
- name: Commit files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
GIT_STATUS=$(git status -s)
[[ ! -z "$GIT_STATUS" ]] && git add ${{ matrix.app_dir }}/spec.json && git commit -m "update spec.json" -a || echo "No changes to commit"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}