Skip to content

Commit

Permalink
simplify ipfs process (#2241)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmance authored Nov 15, 2024
1 parent 3188790 commit 93c31c4
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 263 deletions.
95 changes: 0 additions & 95 deletions .github/actions/dev-ipfs-pin/action.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/actions/ipfs-pin/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Pin to ipfs cluster and nodes
description: Upload build to ipfs node
inputs:
BUILD_PATH:
description: path to the build directory
required: true
PINATA_HASH:
description: ''
required: true
IPFS_SERVER_PORT:
description: ''
required: true
IPFS_SERVER:
description: ''
required: true
IPFS_SERVER_KEY:
description: ''
required: true

runs:
using: 'composite'
steps:
- name: Prepare env and Compress build on IPFS servers
id: ipfs-prepare
continue-on-error: false
shell: bash
run: |
tar -czf app.tar.gz './${{ inputs.BUILD_PATH }}'
rm -rf ./key
echo -n "${{ inputs.IPFS_SERVER_KEY }}" | base64 -d >> ./key && chmod 400 ./key
- name: Upload build to IPFS Primary Server
id: ipfs-scp-primary
continue-on-error: false
shell: bash
run: |
scp -o StrictHostKeyChecking=no \
-i ./key \
-P \${{ inputs.IPFS_SERVER_PORT }} app.tar.gz ipfs@\${{ inputs.IPFS_SERVER }}:.
ssh -o StrictHostKeyChecking=no \
-p \${{ inputs.IPFS_SERVER_PORT }} \
-i ./key ipfs@\${{ inputs.IPFS_SERVER }} "tar zxf app.tar.gz && ipfs add -rQ --cid-version=1 ./${{ inputs.BUILD_PATH }}/"
- name: Clean build and tmp directory on Servers
continue-on-error: false
id: ipfs-clean
shell: bash
run: |
ssh -o StrictHostKeyChecking=no \
-p \${{ inputs.IPFS_SERVER_PORT }} \
-i ./key ipfs@\${{ inputs.IPFS_SERVER }} "rm -rf ./${{ inputs.BUILD_PATH }}/ app.tar.gz"
100 changes: 0 additions & 100 deletions .github/actions/production-ipfs-pin/action.yml

This file was deleted.

5 changes: 1 addition & 4 deletions .github/workflows/build-test-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,8 @@ jobs:

- name: Pin to primary IPFS server
id: ipfs-primary
uses: ./.github/actions/dev-ipfs-pin
uses: ./.github/actions/ipfs-pin
with:
GCP_SA_KEY: '${{ secrets.GCP_SA_KEY }}'
GKE_CLUSTER: '${{ secrets.GKE_CLUSTER }}'
GKE_CLUSTER_REGION: '${{ secrets.GKE_CLUSTER_REGION }}'
IPFS_SERVER_PORT: '${{ secrets.IPFS_PRIMARY_SERVER_PORT }}'
IPFS_SERVER: '${{ secrets.IPFS_PRIMARY_SERVER }}'
IPFS_SERVER_KEY: '${{ secrets.IPFS_PRIMARY_SERVER_KEY }}'
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/test-deploy-fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,8 @@ jobs:

- name: Pin to primary IPFS server
id: ipfs-primary
uses: ./.github/actions/dev-ipfs-pin
uses: ./.github/actions/ipfs-pin
with:
GCP_SA_KEY: '${{ secrets.GCP_SA_KEY }}'
GKE_CLUSTER: '${{ secrets.GKE_CLUSTER }}'
GKE_CLUSTER_REGION: '${{ secrets.GKE_CLUSTER_REGION }}'
IPFS_SERVER_PORT: '${{ secrets.IPFS_PRIMARY_SERVER_PORT }}'
IPFS_SERVER: '${{ secrets.IPFS_PRIMARY_SERVER }}'
IPFS_SERVER_KEY: '${{ secrets.IPFS_PRIMARY_SERVER_KEY }}'
Expand Down
Loading

2 comments on commit 93c31c4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

Please sign in to comment.