Skip to content

Create datahub PR

Create datahub PR #8

name: Create datahub PR
on:
workflow_run:
workflows: ['Build and push container image']
types: [completed]
branches:
- main
jobs:
create-pr:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
env:
HUB: ${{ vars.HUB }}
IMAGE: ${{ vars.IMAGE }}
outputs:
artifact-downloaded: ${{ steps.download-artifact.outputs.test-artifact }}
steps:
- name: cleanup disk space
run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc
df -h
- name: Test if vars works
run: |
echo "with vars:"
echo ${{ vars.IMAGE }}
echo "no vars:"
echo ${IMAGE}
- name: Checkout
uses: actions/checkout@v4
- name: Display free space
run: |
echo "Free space:"
df -h
- name: download artifact with image tag
uses: actions/download-artifact@v4
with:
name: image-tag.txt
path: ./
- name: sanity check on downloaded artifact
run: |
ls -la
cat image-tag.txt
- name: test if image-tag.txt was downloaded
id: test-artifact
run: |
if test -f image-tag.txt; then
echo "::set-output name=artifact-downloaded::true"
else
echo "::set-output name=artifact-downloaded::false"
fi
- name: Parse image tag
if: steps.test-artifact.outputs.artifact-downloaded == 'true'
run: |
IMAGE_TAG=$(cat image-tag.txt)
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- 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
# Lets us monitor disks getting full as images get bigger over time
- name: Show how much disk space is left
run: df -h