Skip to content

Commit

Permalink
Merge pull request #29 from shaneknapp/test-mostly-complete-workflow
Browse files Browse the repository at this point in the history
Test mostly complete workflow
  • Loading branch information
shaneknapp authored Jul 22, 2024
2 parents 38e674a + 364b09a commit dc737bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
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

0 comments on commit dc737bb

Please sign in to comment.