Skip to content

Commit

Permalink
try build docker with GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Mar 25, 2024
1 parent 11ea17e commit 13c5308
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
docker:
# build and test docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: |
user_name="bids"
docker build . --file Dockerfile --tag ${user_name}/bidspm
mkdir -p "${HOME}/docker"
docker save "${user_name}/bidspm" > "${HOME}/docker/image.tar"
# - name: Restore cached data ds000017
# id: cache
# uses: actions/cache/restore@v4
# with:
# path: /home/runner/work/giga_connectome/giga_connectome/giga_connectome/data/test_data
# key: ds000017

# - name: Test the Docker image
# run: |
# docker load -i ${HOME}/docker/image.tar
# docker run --rm --read-only \
# -v /home/runner/work/giga_connectome/giga_connectome/giga_connectome/data/test_data:/test_data \
# -v ./outputs:/outputs \
# -v ./outputs/working_dir:/work \
# bids/giga_connectome \
# /test_data/ds000017-fmriprep22.0.1-downsampled-nosurface \
# /outputs \
# participant \
# -w /work \
# --participant_label 1 \
# --reindex-bids

# - name: Upload output artifact
# uses: actions/upload-artifact@v3
# with:
# name: connectome
# path: ./outputs/
# - name: Upload docker image artifact
# uses: actions/upload-artifact@v3
# with:
# name: docker-image
# path: ${HOME}/docker/image.tar

# publish:
# runs-on: ubuntu-latest
# needs: [test-package, test-coverage]
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: dist
# path: dist/
# - uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 13c5308

Please sign in to comment.