From d1e73cf1dd6616dc69ea694d228ed57dc602c710 Mon Sep 17 00:00:00 2001 From: Jan Gleytenhoover Date: Fri, 16 Aug 2024 12:11:39 +0000 Subject: [PATCH] Update .gitea/workflows/php-deployer.yaml --- .gitea/workflows/php-deployer.yaml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/php-deployer.yaml b/.gitea/workflows/php-deployer.yaml index 7be1b51..3982f46 100644 --- a/.gitea/workflows/php-deployer.yaml +++ b/.gitea/workflows/php-deployer.yaml @@ -1,12 +1,17 @@ name: PHP deployer + +# Variable for the image name +env: + image_name: php-deployer + on: schedule: - cron: "@weekly" push: branches: [main] paths: - - .gitea/workflows/php-deployer.yaml - - images/actions/php-deployer/** + - .gitea/workflows/${{ env.image_name }}.yaml + - images/actions/${{ env.image_name }}/** pull_request: jobs: @@ -39,20 +44,20 @@ jobs: uses: actions/cache@v4 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-php-deployer-${{ github.sha }} + key: ${{ runner.os }}-${{ env.image_name }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-php-deployer- + ${{ runner.os }}-${{ env.image_name }}- - name: Build and push uses: https://git.kjan.de/actions/build-push-action@v6 with: cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - context: ./images/actions/php-deployer + context: ./images/actions/${{ env.image_name }} push: ${{ github.ref == 'refs/heads/main' }} tags: | - git.kjan.de/actions/php-deployer:latest - git.kjan.de/actions/php-deployer:${{ gitea.sha }} + git.kjan.de/actions/${{ env.image_name }}:latest + git.kjan.de/actions/${{ env.image_name }}:${{ gitea.sha }} - # Temp fix # https://github.com/docker/build-push-action/issues/252 @@ -60,4 +65,4 @@ jobs: name: Move cache run: | rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache