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

Test mostly complete workflow #29

Merged
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
18 changes: 12 additions & 6 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build and push container image

# try to follow the example here: https://gist.github.com/Daniel-ltw/552b90800b07c22e4a83dfa68ada6318
on:
push:
branches:
Expand All @@ -11,7 +11,8 @@ jobs:
env:
DOCKER_CONFIG: $HOME/.docker
HUB: ${{ vars.HUB }}

outputs:
image-tag: ${{ steps.build-and-push.outputs.image-tag }}
steps:
- name: Generate the image name
run: |
Expand All @@ -25,9 +26,9 @@ jobs:

- name: Maximize build space
if: steps.changed-files.outputs.any_changed == 'true'
uses: easimon/maximize-build-space@master
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 512
root-reserve-mb: 1024
swap-size-mb: 1024
remove-dotnet: 'true'

Expand All @@ -53,20 +54,25 @@ jobs:
password: ${{ secrets.GAR_SECRET_KEY }}

- name: Build the image and push to artifact registry
id: build-and-push
if: steps.changed-files.outputs.any_changed == 'true'
uses: jupyterhub/repo2docker-action@master
with:
# Make sure username & password/token pair matches your registry credentials
DOCKER_REGISTRY: us-central1-docker.pkg.dev
IMAGE_NAME: ucb-datahub-2018/user-images/${IMAGE}
IMAGE_NAME: ${IMAGE}
# Disable pushing a 'latest' tag, as this often just causes confusion
# LATEST_TAG_OFF: true
LATEST_TAG_OFF: true
# Put repo contents in /srv/repo, rather than the default (/home/jovyan). The home directory
# is mounted over by persistent storage when we are using the built image in a JupyterHub, and
# so all contents put in /home/jovyan are lost. This particularly prevents any 'start' script from
# working, as it is needed in runtime.
REPO_DIR: /srv/repo

- name: print the image name
run: |
echo ${{ steps.build-and-push.outputs.IMAGE_SHA_TAG }}

# Lets us monitor disks getting full as images get bigger over time
- name: Show how much disk space is left
run: df -h
5 changes: 3 additions & 2 deletions .github/workflows/open-datahub-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
create-pr:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
env:
HUB: ${{ vars.HUB }}
Expand All @@ -22,9 +23,9 @@ jobs:
- name: Test if vars works
run: |
echo "with vars:"
echo ${{ vars.HUB }}
echo ${{ vars.IMAGE }}
echo "no vars:"
echo ${HUB}
echo ${IMAGE}

- name: Maximize build space
uses: easimon/maximize-build-space@master
Expand Down