diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index bf5eb4a..c4bec61 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -27,18 +27,17 @@ on: description: 'NaaVRE base image version' type: string required: false + free_disk_space: + description: 'Free disk space on the action runner before running jobs' + type: boolean + required: false + default: false jobs: build: name: Build ${{ inputs.image_name }} runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Free Up GitHub Actions Ubuntu Runner Disk Space uses: jlumbroso/free-disk-space@v1.3.1 with: @@ -49,6 +48,13 @@ jobs: large-packages: true docker-images: false swap-storage: true + if: ${{ inputs.free_disk_space }} + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - id: find-dockerfile name: Find Dockerfile diff --git a/.github/workflows/make-flavor.yaml b/.github/workflows/make-flavor.yaml index 1b59359..2216ab6 100644 --- a/.github/workflows/make-flavor.yaml +++ b/.github/workflows/make-flavor.yaml @@ -23,6 +23,10 @@ on: description: 'Whether to build the NaaVRE Jupyter images' type: boolean required: true + free_disk_space: + description: 'Free disk space on the action runner before running jobs' + type: boolean + required: true jobs: build-naavre-cell-build: @@ -52,6 +56,7 @@ jobs: image_repo: ${{ inputs.image_repo }} image_version: ${{ inputs.naavre_version }}-${{ inputs.image_version }} naavre_version: ${{ inputs.naavre_version }} + free_disk_space: ${{ inputs.free_disk_space }} if: ${{ inputs.build_jupyter }} test: @@ -85,4 +90,5 @@ jobs: with: image_name: naavre-jupyter-${{ inputs.flavor_name }} image_repo: ${{ inputs.image_repo }} + free_disk_space: ${{ inputs.free_disk_space }} if: ${{ github.event_name == 'release' && inputs.build_jupyter }} diff --git a/.github/workflows/make.yaml b/.github/workflows/make.yaml index 81cbae9..4228ba3 100644 --- a/.github/workflows/make.yaml +++ b/.github/workflows/make.yaml @@ -35,6 +35,7 @@ jobs: image_version: ${{ github.ref_type == 'tag' && github.ref_name || github.sha }} naavre_version: 'v2.4.0-alpha.1' build_jupyter: ${{ matrix.build_jupyter }} + free_disk_space: ${{ matrix.free_disk_space }} strategy: matrix: ${{ fromJson(needs.list-flavors.outputs.matrix) }} diff --git a/.github/workflows/push-image.yaml b/.github/workflows/push-image.yaml index dd529c1..bfb7d6f 100644 --- a/.github/workflows/push-image.yaml +++ b/.github/workflows/push-image.yaml @@ -11,12 +11,29 @@ on: description: 'Docker image repo' type: string required: true + free_disk_space: + description: 'Free disk space on the action runner before running jobs' + type: boolean + required: false + default: false jobs: push: name: Push ${{ inputs.image_name }} runs-on: ubuntu-latest steps: + - name: Free Up GitHub Actions Ubuntu Runner Disk Space + uses: jlumbroso/free-disk-space@v1.3.1 + with: + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: false + swap-storage: true + if: ${{ inputs.free_disk_space }} + - name: Download artifact uses: actions/download-artifact@v4 with: diff --git a/flavors/laserfarm/flavor_config.yaml b/flavors/laserfarm/flavor_config.yaml index 0516b02..2a69998 100644 --- a/flavors/laserfarm/flavor_config.yaml +++ b/flavors/laserfarm/flavor_config.yaml @@ -1,2 +1,3 @@ flavor_name: laserfarm -build_jupyter: True \ No newline at end of file +build_jupyter: True +free_disk_space: True diff --git a/flavors/lter-life-veluwe/flavor_config.yaml b/flavors/lter-life-veluwe/flavor_config.yaml index a34ad98..0957735 100644 --- a/flavors/lter-life-veluwe/flavor_config.yaml +++ b/flavors/lter-life-veluwe/flavor_config.yaml @@ -1,2 +1,3 @@ flavor_name: lter-life-veluwe -build_jupyter: True \ No newline at end of file +build_jupyter: True +free_disk_space: False diff --git a/flavors/python/flavor_config.yaml b/flavors/python/flavor_config.yaml index 3b36f98..ad7b9ad 100644 --- a/flavors/python/flavor_config.yaml +++ b/flavors/python/flavor_config.yaml @@ -1,2 +1,3 @@ flavor_name: python -build_jupyter: False \ No newline at end of file +build_jupyter: False +free_disk_space: False diff --git a/flavors/r/flavor_config.yaml b/flavors/r/flavor_config.yaml index acadd39..be181c2 100644 --- a/flavors/r/flavor_config.yaml +++ b/flavors/r/flavor_config.yaml @@ -1,2 +1,3 @@ flavor_name: r -build_jupyter: False \ No newline at end of file +build_jupyter: False +free_disk_space: False diff --git a/flavors/vol2bird/flavor_config.yaml b/flavors/vol2bird/flavor_config.yaml index af5b437..30122b0 100644 --- a/flavors/vol2bird/flavor_config.yaml +++ b/flavors/vol2bird/flavor_config.yaml @@ -1,2 +1,3 @@ flavor_name: vol2bird -build_jupyter: True \ No newline at end of file +build_jupyter: True +free_disk_space: False