From d837b6f4ef3163adc1d55d64edd9b6cd36c6faa7 Mon Sep 17 00:00:00 2001 From: jiriks74 Date: Sun, 22 Sep 2024 23:05:26 +0200 Subject: [PATCH] fix(ci/cd): Cache apt packages --- .gitea/workflows/build.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 354bbbe..2e489b0 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -13,19 +13,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - - name: Install Docker - run: | - apt-get update - apt-get install docker.io -y - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - platforms: linux/amd64,linux/arm64 - name: Get upstream repository run: | @@ -43,12 +30,24 @@ jobs: id: check-build-status run: | echo ${{ steps.meta.outputs.tag }} - if curl --silent -f -lSL "https://hub.docker.com/v2/repositories/jiriks74/onlyoffice-documentserver/tags/$(echo ${{ steps.meta.outputs.tag }})" > /dev/null; then echo "Already exists" && exit 1; else echo "Desn't exist" && exit 0; fi + if curl --silent -f -lSL "https://hub.docker.com/v2/repositories/jiriks74/onlyoffice-documentserver/tags/$(echo ${{ steps.meta.outputs.tag }})" > /dev/null; then echo "Already exists" && exit 0; else echo "Desn't exist" && exit 0; fi - name: Set tag in Dockerfile run: | sed -i "s/ARG PACKAGE_VERSION=/ARG PACKAGE_VERSION=$(echo ${{ steps.meta.outputs.tag }} | cut -d ':' -f2)/g" Dockerfile + - name: Install Docker + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: docker.io + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + platforms: linux/amd64,linux/arm64 + - name: Login to DockerHub uses: docker/login-action@v1 with: