diff --git a/.github/workflows/github-actions-demo.yaml b/.github/workflows/github-actions-demo.yaml index 0700bc8..28f4775 100644 --- a/.github/workflows/github-actions-demo.yaml +++ b/.github/workflows/github-actions-demo.yaml @@ -38,34 +38,23 @@ jobs: runs-on: ubuntu-latest environment: production steps: - - name: Docker pull - run: | - docker pull ipfs/kubo:latest - - - name: Start the container - run: | - docker run -d --name ipfs_host -v /tmp/ipfsin/:/export -v /tmp/ipfsout/:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/kubo:latest - - name: Download build file uses: actions/download-artifact@v4 with: name: vesla0x1-portfolio path: public - - name: Add build files to IPFS - run: | - sudo cp -r public /tmp/ipfsin/public - docker exec ipfs_host ipfs --api /ip4/177.68.188.238/tcp/45005/ add -r export/public - docker exec ipfs_host mv out data/ipfs - - - name: Log output - run: | - cat /tmp/ipfsout/out + - name: Install IPFS action + uses: ibnesayeed/setup-ipfs@master + with: + ipfs_version: ^0.4 + run_daemon: true - - name: Pin by CID + - name: Test IPFS action run: | - export CID=$(cat /tmp/ipfsout/out | tail -n 1 | awk '{split($0,s); print s[2]}') - API_URL=https://api.pinata.cloud/pinning/pinByHash - curl -X POST -H "content-type: application/json" \ - -H "Authorization: Bearer ${{ secrets.PINATA_API_SECRET }}" \ - -d "{\"hashToPin\": \"$CID\"}" $API_URL \ No newline at end of file + ipfs add -r public + + - name: Sleep for 30 seconds + uses: jakejarvis/wait-action@master + with: + time: '300s' \ No newline at end of file