diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f52badc..12a68f3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,7 +4,6 @@ on: push: branches: - main - workflow_dispatch: jobs: build-and-push: diff --git a/.github/workflows/build_branch.yaml b/.github/workflows/build_branch.yaml new file mode 100644 index 0000000..6f8ccaa --- /dev/null +++ b/.github/workflows/build_branch.yaml @@ -0,0 +1,43 @@ +name: Branch Build and push container image + +on: + workflow_dispatch: + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + + - name: Exit if main branch + shell: bash + run: | + echo "This is main branch, exiting... Use the other workflow." + exit 1 + if: startsWith(github.ref, 'refs/heads/main') + - name: cleanup disk space + run: | + sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc + df -h + + - name: Set tag name + shell: bash + run: | + echo "TAG_NAME=${GITHUB_REF##*/}" >> "$GITHUB_ENV" + if: ${{ !startsWith(github.ref, 'refs/heads/main') }} + + - name: Checkout files in repo + uses: actions/checkout@main + + - name: Build and push the image to quay.io + uses: jupyterhub/repo2docker-action@master + with: + # Make sure username & password/token pair matches your registry credentials + DOCKER_USERNAME: ${{ secrets.QUAY_CIROH_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.QUAY_CIROH_PASSWORD }} + DOCKER_REGISTRY: "quay.io" + IMAGE_NAME: "awiciroh/devcon24" + ADDITIONAL_TAG: ${{ env.TAG_NAME}} + + # Lets us monitor disks getting full as images get bigger over time + - name: Show how much disk space is left + run: df -h