From 6d5bfab7416a7062062b85afa7e8bb29c920ec8d Mon Sep 17 00:00:00 2001 From: Liudon Date: Thu, 26 Sep 2024 19:37:14 +0800 Subject: [PATCH] fix --- .github/workflows/ipfs.yml | 40 +++++++++++++++++++++++++++++++++----- .github/workflows/main.yml | 6 ++++++ 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ipfs.yml b/.github/workflows/ipfs.yml index a9f6b0fe7..ef10a9f3f 100644 --- a/.github/workflows/ipfs.yml +++ b/.github/workflows/ipfs.yml @@ -3,7 +3,37 @@ name: Publish IPFS # Controls when the action will run. on: workflow_dispatch: + ssh_host: + required: true + type: string + ssh_key: + required: true + type: string + filebase_bucket: + required: true + type: string + filebase_key: + required: true + type: string + filebase_secret: + required: true + type: string workflow_call: + ssh_host: + required: true + type: string + ssh_key: + required: true + type: string + filebase_bucket: + required: true + type: string + filebase_key: + required: true + type: string + filebase_secret: + required: true + type: string permissions: contents: read @@ -50,9 +80,9 @@ jobs: - name: Connect to ssh in BG timeout-minutes: 2 run: | - echo "${{ secrets.SSHKEY }}" > ../privkey + echo "${{ inputs.ssh_key }}" > ../privkey chmod 600 ../privkey - ssh -o StrictHostKeyChecking=no ${{ secrets.SSHHOST }} -i ../privkey -L 5001:localhost:5001 -fTN + ssh -o StrictHostKeyChecking=no ${{ inputs.ssh_host }} -i ../privkey -L 5001:localhost:5001 -fTN - name: IPFS upload uses: filebase/ipfs-action@master @@ -73,7 +103,7 @@ jobs: path: ./public service: filebase pinName: ipfs-action - filebaseBucket: ${{ secrets.FILEBASE_BUCKET }} - filebaseKey: ${{ secrets.FILEBASE_KEY }} - filebaseSecret: ${{ secrets.FILEBASE_SECRET }} + filebaseBucket: ${{ inputs.filebase_bucket }} + filebaseKey: ${{ inputs.filebase_key }} + filebaseSecret: ${{ inputs.filebase_secret }} key: ipfs-action \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d07a24965..19932c56a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,6 +57,12 @@ jobs: ipfs: name: Build and Publish IPFS uses: ./.github/workflows/ipfs.yml + with: + ssh_host: ${{ secrets.SSHHOST }} + ssh_key: ${{ secrets.SSHKEY }} + filebase_bucket: ${{ secrets.FILEBASE_BUCKET }} + filebase_key: ${{ secrets.FILEBASE_KEY }} + filebase_secret: ${{ secrets.FILEBASE_SECRET }} needs: - start