Skip to content

Commit 93c31c4

Browse files
authored
simplify ipfs process (#2241)
1 parent 3188790 commit 93c31c4

File tree

6 files changed

+96
-263
lines changed

6 files changed

+96
-263
lines changed

.github/actions/dev-ipfs-pin/action.yml

Lines changed: 0 additions & 95 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Pin to ipfs cluster and nodes
2+
description: Upload build to ipfs node
3+
inputs:
4+
BUILD_PATH:
5+
description: path to the build directory
6+
required: true
7+
PINATA_HASH:
8+
description: ''
9+
required: true
10+
IPFS_SERVER_PORT:
11+
description: ''
12+
required: true
13+
IPFS_SERVER:
14+
description: ''
15+
required: true
16+
IPFS_SERVER_KEY:
17+
description: ''
18+
required: true
19+
20+
runs:
21+
using: 'composite'
22+
steps:
23+
- name: Prepare env and Compress build on IPFS servers
24+
id: ipfs-prepare
25+
continue-on-error: false
26+
shell: bash
27+
run: |
28+
tar -czf app.tar.gz './${{ inputs.BUILD_PATH }}'
29+
rm -rf ./key
30+
echo -n "${{ inputs.IPFS_SERVER_KEY }}" | base64 -d >> ./key && chmod 400 ./key
31+
32+
- name: Upload build to IPFS Primary Server
33+
id: ipfs-scp-primary
34+
continue-on-error: false
35+
shell: bash
36+
run: |
37+
scp -o StrictHostKeyChecking=no \
38+
-i ./key \
39+
-P \${{ inputs.IPFS_SERVER_PORT }} app.tar.gz ipfs@\${{ inputs.IPFS_SERVER }}:.
40+
ssh -o StrictHostKeyChecking=no \
41+
-p \${{ inputs.IPFS_SERVER_PORT }} \
42+
-i ./key ipfs@\${{ inputs.IPFS_SERVER }} "tar zxf app.tar.gz && ipfs add -rQ --cid-version=1 ./${{ inputs.BUILD_PATH }}/"
43+
44+
- name: Clean build and tmp directory on Servers
45+
continue-on-error: false
46+
id: ipfs-clean
47+
shell: bash
48+
run: |
49+
ssh -o StrictHostKeyChecking=no \
50+
-p \${{ inputs.IPFS_SERVER_PORT }} \
51+
-i ./key ipfs@\${{ inputs.IPFS_SERVER }} "rm -rf ./${{ inputs.BUILD_PATH }}/ app.tar.gz"

.github/actions/production-ipfs-pin/action.yml

Lines changed: 0 additions & 100 deletions
This file was deleted.

.github/workflows/build-test-deploy-dev.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,8 @@ jobs:
127127

128128
- name: Pin to primary IPFS server
129129
id: ipfs-primary
130-
uses: ./.github/actions/dev-ipfs-pin
130+
uses: ./.github/actions/ipfs-pin
131131
with:
132-
GCP_SA_KEY: '${{ secrets.GCP_SA_KEY }}'
133-
GKE_CLUSTER: '${{ secrets.GKE_CLUSTER }}'
134-
GKE_CLUSTER_REGION: '${{ secrets.GKE_CLUSTER_REGION }}'
135132
IPFS_SERVER_PORT: '${{ secrets.IPFS_PRIMARY_SERVER_PORT }}'
136133
IPFS_SERVER: '${{ secrets.IPFS_PRIMARY_SERVER }}'
137134
IPFS_SERVER_KEY: '${{ secrets.IPFS_PRIMARY_SERVER_KEY }}'

.github/workflows/test-deploy-fork.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,8 @@ jobs:
138138

139139
- name: Pin to primary IPFS server
140140
id: ipfs-primary
141-
uses: ./.github/actions/dev-ipfs-pin
141+
uses: ./.github/actions/ipfs-pin
142142
with:
143-
GCP_SA_KEY: '${{ secrets.GCP_SA_KEY }}'
144-
GKE_CLUSTER: '${{ secrets.GKE_CLUSTER }}'
145-
GKE_CLUSTER_REGION: '${{ secrets.GKE_CLUSTER_REGION }}'
146143
IPFS_SERVER_PORT: '${{ secrets.IPFS_PRIMARY_SERVER_PORT }}'
147144
IPFS_SERVER: '${{ secrets.IPFS_PRIMARY_SERVER }}'
148145
IPFS_SERVER_KEY: '${{ secrets.IPFS_PRIMARY_SERVER_KEY }}'

0 commit comments

Comments
 (0)