Skip to content

Commit 962f869

Browse files
committed
chore(ci): free disk space on docker publish
1 parent de5fbff commit 962f869

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.github/workflows/publish-docker.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@ jobs:
1919
packages: write
2020

2121
steps:
22+
- name: Free disk space
23+
run: |
24+
echo "Disk space before cleanup:"
25+
df -h
26+
27+
# Remove unnecessary large packages
28+
sudo apt-get remove -y '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' '^postgresql-.*'
29+
sudo apt-get autoremove -y
30+
sudo apt-get clean
31+
32+
# Remove Android SDK
33+
sudo rm -rf /usr/local/lib/android
34+
35+
# Remove .NET Core
36+
sudo rm -rf /usr/share/dotnet
37+
38+
# Remove Docker images
39+
docker rmi $(docker images -q) || true
40+
41+
echo "Disk space after cleanup:"
42+
df -h
43+
2244
- name: Check out the repo
2345
uses: actions/checkout@v4
2446

@@ -52,3 +74,5 @@ jobs:
5274
labels: ${{ steps.meta.outputs.labels }}
5375
cache-from: type=gha
5476
cache-to: type=gha,mode=max
77+
build-args: |
78+
BUILDKIT_INLINE_CACHE=1

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
permissions:
99
contents: read
1010
packages: write
11+
id-token: write
1112

1213
jobs:
1314
build:

0 commit comments

Comments
 (0)