Skip to content

Commit

Permalink
set up image environment build action
Browse files Browse the repository at this point in the history
  • Loading branch information
jmunroe committed May 30, 2024
1 parent 05a6dd0 commit c1bf0f5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and push container image

on:
push:
branches:
- main
paths:
- 'image/**'

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:

# For biggish images, github actions runs out of disk space.
# So we cleanup some unwanted things in the disk image, and reclaim that space for our docker use
# https://github.com/actions/virtual-environments/issues/2606#issuecomment-772683150
# and https://github.com/easimon/maximize-build-space/blob/b4d02c14493a9653fe7af06cc89ca5298071c66e/action.yml#L104
# This gives us a total of about 52G of free space, which should be enough for now
- name: cleanup disk space
run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc
df -h
- name: Checkout files in repo
uses: actions/checkout@main

- name: Build and push the image to quay.io
id: build-push
uses: jupyterhub/repo2docker-action@master
with:
# Make sure username & password/token pair matches your registry credentials
DOCKER_USERNAME: ${{ secrets.QUAY_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
DOCKER_REGISTRY: "quay.io"
# Disable pushing a 'latest' tag, as this often just causes confusion
LATEST_TAG_OFF: false

# Uncomment and modify the following line with your image name, otherwise no push will happen
IMAGE_NAME: "2i2c/bioinfo-image"

# Lets us monitor disks getting full as images get bigger over time
- name: Show how much disk space is left
run: df -h
2 changes: 2 additions & 0 deletions image/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gh-scoped-creds
nbgitpuller

0 comments on commit c1bf0f5

Please sign in to comment.