Branch Build and push container image #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |