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

merging the build and push, plus pr creation workflows in to one #39

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
46 changes: 37 additions & 9 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
with:
# Make sure username & password/token pair matches your registry credentials
DOCKER_REGISTRY: us-central1-docker.pkg.dev
IMAGE_NAME: $IMAGE
IMAGE_NAME: ucb-datahub-2018/user-images/logodev-user-image
# Disable pushing a 'latest' tag, as this often just causes confusion
LATEST_TAG_OFF: true
# Put repo contents in /srv/repo, rather than the default (/home/jovyan). The home directory
Expand All @@ -63,18 +63,46 @@ jobs:
# working, as it is needed in runtime.
REPO_DIR: /srv/repo

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

- name: Save image tag as an artifact
run: echo ${{ steps.build-and-push.outputs.IMAGE_SHA_TAG }} > image-tag.txt
- uses: actions/upload-artifact@v4
with:
name: image-tag
path: ./image-tag.txt
compression-level: 0
- name: store the image tag as an env var
run: |
IMAGE_TAG=${{ steps.build-and-push.outputs.IMAGE_SHA_TAG }}
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV

# Lets us monitor disks getting full as images get bigger over time
- name: Show how much disk space is left
run: df -h

create-pr:
runs-on: ubuntu-latest
needs: build-and-push
steps:
- name: print the hash
run: |
echo $IMAGE_TAG
echo ${{ needs.build-and-push.outputs.image-tag }}
echo "IMAGE_TAG=${{ needs.build-and-push.outputs.image-tag }}" >> $GITHUB_ENV

- name: logic test
run: |
if [ -z "$IMAGE_TAG" ]; then
echo "CREATE_PR=false" >> $GITHUB_ENV
else
echo "CREATE_PR=true" >> $GITHUB_ENV
fi

- name: Checkout files in repo
uses: actions/checkout@v4
with:
repository: 'berkeley-dsep-infra/datahub'
sparse-checkout: |
hub/
deployments/${HUB}

- name: see if the correct dir has been checked out, and the requirements have been installed
run: |
ls -la
tree
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
- matplotlib==3.7.1
- mdit-py-plugins==0.4.0
- numpy==1.24.2
- pandas==2.2.2
- pandas==2.0.2
- plotly==5.13.1
- requests==2.28.2
- scikit-image==0.19.3
Expand Down