-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
steps to only compile containers when dockerfile changes (hopefully)
- Loading branch information
Showing
1 changed file
with
20 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,19 +31,26 @@ jobs: | |
echo "dockerfile_changed=false" >> $GITHUB_ENV | ||
fi | ||
- name: Extract metadata (tags, labels) for Rmd Docker | ||
id: meta_rmd | ||
uses: docker/[email protected] | ||
with: | ||
images: bcgsc/long-pog-rmd | ||
|
||
- name: Build and push Docker image | ||
if: env.dockerfile_changed == 'true' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: container/rmd.Dockerfile | ||
context: . | ||
push: false # Set to true if you want to push the image to a registry | ||
tags: notebook-runner | ||
push: true | ||
tags: ${{ steps.meta_rmd.outputs.tags }} | ||
labels: ${{ steps.meta_rmd.outputs.labels }} | ||
|
||
- name: Run Docker container to compile assets | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: notebook-runner | ||
image: ${{ steps.meta_rmd.outputs.tags }} | ||
options: -v ${{ github.workspace }}:/workspace --rm -u root | ||
run: | | ||
RMD_FILES=$( find /workspace -name "*Rmd" -o -name "*rmd" ) | ||
|
@@ -77,21 +84,28 @@ jobs: | |
echo "dockerfile_changed=false" >> $GITHUB_ENV | ||
fi | ||
- name: Extract metadata (tags, labels) for Jupyter Docker | ||
id: meta_jupyter | ||
uses: docker/[email protected] | ||
with: | ||
images: bcgsc/long-pog-jupyter | ||
|
||
- name: Build and push Docker image | ||
if: env.dockerfile_changed == 'true' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: container/jupyter.Dockerfile | ||
context: . | ||
push: false # Set to true if you want to push the image to a registry | ||
tags: notebook-runner | ||
push: true | ||
tags: ${{ steps.meta_jupyter.outputs.tags }} | ||
labels: ${{ steps.meta_jupyter.outputs.labels }} | ||
|
||
|
||
|
||
- name: Run Docker container to compile JupyterNotebook | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: notebook-runner | ||
image: ${{ steps.meta_jupyter.outputs.tags }} | ||
options: -v ${{ github.workspace }}:/workspace --rm -u root | ||
run: | | ||
notebooks=$(find /workspace -name "*.ipynb") | ||
|