From ae004073f0adc8221847112e93a7e46ba1497f02 Mon Sep 17 00:00:00 2001 From: Jan Gleytenhoover Date: Fri, 16 Aug 2024 12:03:35 +0000 Subject: [PATCH] Update .gitea/workflows/node-npm.yaml --- .gitea/workflows/node-npm.yaml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/node-npm.yaml b/.gitea/workflows/node-npm.yaml index 32aa7ad..9112537 100644 --- a/.gitea/workflows/node-npm.yaml +++ b/.gitea/workflows/node-npm.yaml @@ -1,14 +1,18 @@ name: Node npm + +# Variable for the image name +image_name: node-npm + on: schedule: - cron: "@weekly" push: branches: [main] paths: - - .gitea/workflows/node-npm.yaml - - images/actions/node-npm/** + - .gitea/workflows/${{ vars.image_name }}.yaml + - images/actions/${{ vars.image_name }}/** pull_request: - + jobs: build: name: Build and push image @@ -39,20 +43,20 @@ jobs: uses: actions/cache@v4 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-node-npm-${{ github.sha }} + key: ${{ runner.os }}-${{ vars.image_name }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-node-npm- + ${{ runner.os }}-${{ vars.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/node-npm + context: ./images/actions/${{ vars.image_name }} push: ${{ github.ref == 'refs/heads/main' }} tags: | - git.kjan.de/actions/node-npm:latest - git.kjan.de/actions/node-npm:${{ gitea.sha }} + git.kjan.de/actions/${{ vars.image_name }}:latest + git.kjan.de/actions/${{ vars.image_name }}:${{ gitea.sha }} - # Temp fix # https://github.com/docker/build-push-action/issues/252 @@ -60,4 +64,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