From 9f7a6c39a3d318d064b1b9e2c00e8bfb097fff99 Mon Sep 17 00:00:00 2001 From: Jan Gleytenhoover Date: Fri, 16 Aug 2024 12:28:24 +0000 Subject: [PATCH] Update .gitea/workflows/node-npm.yaml (#10) Reviewed-on: https://git.kjan.de/actions/runner-images/pulls/10 --- .gitea/workflows/node-npm.yaml | 23 ++++++++++++++--------- .gitea/workflows/node-ssh.yaml | 21 +++++++++++++-------- .gitea/workflows/php-8.2.yaml | 21 ++++++++++++--------- .gitea/workflows/php-deployer.yaml | 21 +++++++++++++-------- .gitea/workflows/rust-node.yaml | 21 +++++++++++++-------- 5 files changed, 65 insertions(+), 42 deletions(-) diff --git a/.gitea/workflows/node-npm.yaml b/.gitea/workflows/node-npm.yaml index 32aa7ad..81d4b75 100644 --- a/.gitea/workflows/node-npm.yaml +++ b/.gitea/workflows/node-npm.yaml @@ -1,14 +1,19 @@ name: Node npm + +# Variable for the image name +env: + image_name: node-npm + on: schedule: - cron: "@weekly" push: branches: [main] paths: - - .gitea/workflows/node-npm.yaml - - images/actions/node-npm/** + - .gitea/workflows/${{ env.image_name }}.yaml + - images/actions/${{ env.image_name }}/** pull_request: - + jobs: build: name: Build and push image @@ -39,20 +44,20 @@ jobs: uses: actions/cache@v4 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-node-npm-${{ github.sha }} + key: ${{ runner.os }}-${{ env.image_name }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-node-npm- + ${{ 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/node-npm + context: ./images/actions/${{ env.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/${{ 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 diff --git a/.gitea/workflows/node-ssh.yaml b/.gitea/workflows/node-ssh.yaml index 0bd7c69..8874d49 100644 --- a/.gitea/workflows/node-ssh.yaml +++ b/.gitea/workflows/node-ssh.yaml @@ -1,12 +1,17 @@ name: Node ssh + +# Variable for the image name +env: + image_name: node-ssh + on: schedule: - cron: "@weekly" push: branches: [main] paths: - - .gitea/workflows/node-ssh.yaml - - images/actions/node-ssh/** + - .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 }}-node-ssh-${{ github.sha }} + key: ${{ runner.os }}-${{ env.image_name }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-node-ssh- + ${{ 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/node-ssh + context: ./images/actions/${{ env.image_name }} push: ${{ github.ref == 'refs/heads/main' }} tags: | - git.kjan.de/actions/node-ssh:latest - git.kjan.de/actions/node-ssh:${{ 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 diff --git a/.gitea/workflows/php-8.2.yaml b/.gitea/workflows/php-8.2.yaml index 944f9dc..ad12b69 100644 --- a/.gitea/workflows/php-8.2.yaml +++ b/.gitea/workflows/php-8.2.yaml @@ -1,12 +1,16 @@ name: PHP 8.2 +# Variable for the image name +env: + image_name: php-8.2 + on: schedule: - cron: "@weekly" push: branches: [main] paths: - - .gitea/workflows/php-8.2.yaml - - images/actions/php-8.2/** + - .gitea/workflows/${{ env.image_name }}.yaml + - images/actions/${{ env.image_name }}/** pull_request: jobs: @@ -39,20 +43,20 @@ jobs: uses: actions/cache@v4 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-php-8-2-${{ github.sha }} + key: ${{ runner.os }}-${{ env.image_name }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-php-8-2- + ${{ 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-8.2 + context: ./images/actions/${{ env.image_name }} push: ${{ github.ref == 'refs/heads/main' }} tags: | - git.kjan.de/actions/php-8.2:latest - git.kjan.de/actions/php-8.2:${{ 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,5 +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 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 diff --git a/.gitea/workflows/rust-node.yaml b/.gitea/workflows/rust-node.yaml index d6cd93c..dcecd3c 100644 --- a/.gitea/workflows/rust-node.yaml +++ b/.gitea/workflows/rust-node.yaml @@ -1,12 +1,17 @@ name: Rust node + +# Variable for the image name +env: + image_name: rust-node + on: schedule: - cron: "@weekly" push: branches: [main] paths: - - .gitea/workflows/rust-node.yaml - - images/actions/rust-node/** + - .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 }}-rust-node-${{ github.sha }} + key: ${{ runner.os }}-${{ env.image_name }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-rust-node- + ${{ 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/rust-node + context: ./images/actions/${{ env.image_name }} push: ${{ github.ref == 'refs/heads/main' }} tags: | - git.kjan.de/actions/rust-node:latest - git.kjan.de/actions/rust-node:${{ 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