diff --git a/.github/workflows/build-gluon.yml b/.github/workflows/build-gluon.yml
index 2834b8dcdb7ba75ec9ef5136c5552e94cd13d33c..6347a213a3fb12bfae98ff642ad3a6486e0ea1a2 100644
--- a/.github/workflows/build-gluon.yml
+++ b/.github/workflows/build-gluon.yml
@@ -14,6 +14,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh ar71xx-generic
       - name: Archive build output
@@ -27,6 +29,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh ar71xx-tiny
       - name: Archive build output
@@ -40,6 +44,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh ar71xx-nand
       - name: Archive build output
@@ -53,6 +59,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh ath79-generic
       - name: Archive build output
@@ -66,6 +74,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh brcm2708-bcm2708
       - name: Archive build output
@@ -79,6 +89,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh brcm2708-bcm2709
       - name: Archive build output
@@ -92,6 +104,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh ipq40xx-generic
       - name: Archive build output
@@ -105,6 +119,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh ipq806x-generic
       - name: Archive build output
@@ -118,6 +134,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh lantiq-xrx200
       - name: Archive build output
@@ -131,6 +149,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh lantiq-xway
       - name: Archive build output
@@ -144,6 +164,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh mpc85xx-generic
       - name: Archive build output
@@ -157,6 +179,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh mpc85xx-p1020
       - name: Archive build output
@@ -170,6 +194,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh ramips-mt7620
       - name: Archive build output
@@ -183,6 +209,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh ramips-mt7621
       - name: Archive build output
@@ -196,6 +224,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh ramips-mt76x8
       - name: Archive build output
@@ -209,6 +239,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh ramips-rt305x
       - name: Archive build output
@@ -222,6 +254,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh sunxi-cortexa7
       - name: Archive build output
@@ -235,6 +269,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh x86-generic
       - name: Archive build output
@@ -248,6 +284,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh x86-geode
       - name: Archive build output
@@ -261,6 +299,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh x86-64
       - name: Archive build output
@@ -274,6 +314,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh ar71xx-mikrotik
       - name: Archive build output
@@ -287,6 +329,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh brcm2708-bcm2710
       - name: Archive build output
@@ -300,6 +344,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh mvebu-cortexa9
       - name: Archive build output
diff --git a/contrib/actions/generate-actions.py b/contrib/actions/generate-actions.py
index 2b203697e82f3561694307958d1ba41a52e0d38d..d4003360fcc72fee668e9c5bbe737c1db9112399 100755
--- a/contrib/actions/generate-actions.py
+++ b/contrib/actions/generate-actions.py
@@ -20,6 +20,8 @@ ACTIONS_TARGET="""
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v1
+      - name: Install Dependencies
+        run: bash contrib/actions/install-dependencies.sh
       - name: Build
         run: bash contrib/actions/run-build.sh {target_name}
       - name: Archive build output
diff --git a/contrib/actions/install-dependencies.sh b/contrib/actions/install-dependencies.sh
new file mode 100755
index 0000000000000000000000000000000000000000..730f92c7559e3052054e1d2e5e03486d5a1065a0
--- /dev/null
+++ b/contrib/actions/install-dependencies.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+sudo apt install git subversion build-essential python gawk unzip libncurses5-dev zlib1g-dev libssl-dev wget time || exit 1
+sudo apt clean
+sudo rm -rf /var/lib/apt/lists/*
diff --git a/contrib/actions/run-build.sh b/contrib/actions/run-build.sh
index 23b8965f15347855ef9f7cba29f04d371b91297d..1265edd0b00d3005440617be861a2ba88d9d4e0d 100755
--- a/contrib/actions/run-build.sh
+++ b/contrib/actions/run-build.sh
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-sudo apt install git subversion build-essential python gawk unzip libncurses5-dev zlib1g-dev libssl-dev wget time
-
 export BROKEN=1
 export GLUON_DEPRECATED=1
 export GLUON_SITEDIR="contrib/ci/minimal-site"