🗑️(CI) free up space in the GitHub Actions runners
On the release pull request workflows, we sometimes face issues with disk space. We clean up some space before starting Docker services or after finishing to build images to avoid these issues.
This commit is contained in:
24
.github/actions/free-disk-space/action.yml
vendored
Normal file
24
.github/actions/free-disk-space/action.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: 'Free Disk Space'
|
||||||
|
description: 'Free up disk space by removing large preinstalled items and cleaning up Docker'
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Free disk space (Linux only)
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Disk usage before cleanup:"
|
||||||
|
df -h
|
||||||
|
|
||||||
|
# Remove large preinstalled items that are not used on GitHub-hosted runners
|
||||||
|
sudo rm -rf /usr/share/dotnet || true
|
||||||
|
sudo rm -rf /opt/ghc || true
|
||||||
|
sudo rm -rf /usr/local/lib/android || true
|
||||||
|
|
||||||
|
# Clean up Docker
|
||||||
|
docker system prune -af || true
|
||||||
|
docker volume prune -f || true
|
||||||
|
|
||||||
|
echo "Disk usage after cleanup:"
|
||||||
|
df -h
|
||||||
18
.github/workflows/docker-hub.yml
vendored
18
.github/workflows/docker-hub.yml
vendored
@@ -52,6 +52,12 @@ jobs:
|
|||||||
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
|
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
-
|
||||||
|
name: Cleanup Docker after build
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
docker system prune -af
|
||||||
|
docker volume prune -f
|
||||||
|
|
||||||
build-and-push-frontend:
|
build-and-push-frontend:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -91,6 +97,12 @@ jobs:
|
|||||||
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
|
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
-
|
||||||
|
name: Cleanup Docker after build
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
docker system prune -af
|
||||||
|
docker volume prune -f
|
||||||
|
|
||||||
build-and-push-y-provider:
|
build-and-push-y-provider:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -125,6 +137,12 @@ jobs:
|
|||||||
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
|
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'preview') }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
-
|
||||||
|
name: Cleanup Docker after build
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
docker system prune -af
|
||||||
|
docker volume prune -f
|
||||||
|
|
||||||
notify-argocd:
|
notify-argocd:
|
||||||
needs:
|
needs:
|
||||||
|
|||||||
6
.github/workflows/impress-frontend.yml
vendored
6
.github/workflows/impress-frontend.yml
vendored
@@ -85,6 +85,9 @@ jobs:
|
|||||||
- name: Install Playwright Browsers
|
- name: Install Playwright Browsers
|
||||||
run: cd src/frontend/apps/e2e && yarn install --frozen-lockfile && yarn install-playwright chromium
|
run: cd src/frontend/apps/e2e && yarn install --frozen-lockfile && yarn install-playwright chromium
|
||||||
|
|
||||||
|
- name: Free disk space before Docker
|
||||||
|
uses: ./.github/actions/free-disk-space
|
||||||
|
|
||||||
- name: Start Docker services
|
- name: Start Docker services
|
||||||
run: make bootstrap-e2e FLUSH_ARGS='--no-input'
|
run: make bootstrap-e2e FLUSH_ARGS='--no-input'
|
||||||
|
|
||||||
@@ -124,6 +127,9 @@ jobs:
|
|||||||
- name: Install Playwright Browsers
|
- name: Install Playwright Browsers
|
||||||
run: cd src/frontend/apps/e2e && yarn install --frozen-lockfile && yarn install-playwright firefox webkit chromium
|
run: cd src/frontend/apps/e2e && yarn install --frozen-lockfile && yarn install-playwright firefox webkit chromium
|
||||||
|
|
||||||
|
- name: Free disk space before Docker
|
||||||
|
uses: ./.github/actions/free-disk-space
|
||||||
|
|
||||||
- name: Start Docker services
|
- name: Start Docker services
|
||||||
run: make bootstrap-e2e FLUSH_ARGS='--no-input'
|
run: make bootstrap-e2e FLUSH_ARGS='--no-input'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user