• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ipfs-shipyard/ipfs-github-action: Pin your site to IPFS from a GitHub Action

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

ipfs-shipyard/ipfs-github-action

开源软件地址:

https://github.com/ipfs-shipyard/ipfs-github-action

开源编程语言:

Shell 94.8%

开源软件介绍:

IPFS GitHub Action

Publish websites to IPFS as part of a github action workflow. This action pins a directory to IPFS by using the ipfs-cluster-ctl command to pin it to a remote IPFS Cluster. It sets the IPFS URL as a status on the commit that triggered the action, allowing easy previewing of rendered static sites on the dweb.

NOTE: You need to provide credentials to an IPFS cluster instance that you have permission to pin to, in order to make use of this action.

This action uses https://github.com/ipfs-shipyard/ipfs-dns-deploy to do the work.

screenshot

Usage

Use this action from a workflow that build out your static site to a directory. In this example we ask ipfs-github-action to pin the public dir in the current workspace to cluster.ipfs.io

- uses: ipfs-shipyard/ipfs-github-action@v2
  id: ipfs
  with:
    path_to_add: public
    cluster_host: /dnsaddr/cluster.ipfs.io
    cluster_user: ${{ secrets.CLUSTER_USER }}
    cluster_password: ${{ secrets.CLUSTER_PASSWORD }}
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# "bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am"
- run: echo /ipfs/${{ steps.ipfs.outputs.cid }}

# https://bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am.ipfs.dweb.link
- run: echo ${{ steps.ipfs.outputs.url }}

Check the filecoin spec website workflow for a complete example out in the wild that also updates a DNSLink record when with the new cid when a commit changes the production branch.

Inputs

path_to_add

Required The path the root directory of your static website or other content that you want to publish to IPFS.

cluster_user

Required Username for the IPFS Cluster instance

cluster_password

Required Password for the IPFS Cluster instance

cluster_host

Required Multiaddr for the IPFS Cluster. - see: https://cluster.ipfs.io/ Default /dnsaddr/cluster.ipfs.io

ipfs_gateway

Required IPFS subdomain gateway to use for preview url - see: https://docs.ipfs.io/concepts/ipfs-gateway Default dweb.link

If you'd prefer to use /ipfs/<cid> style preview urls, then v1 of this action is the one for you!

see: https://github.com/ipfs-shipyard/ipfs-github-action/releases/tag/v1.0.0

  • Must be the hostname without a scheme prefix. e.g dweb.link not https://dweb.link
  • Links in commit status messages will be prefixed with https. http is not supported; GitHub prevents the target_url property from using http urls.

Outputs

cid

The IPFS content identifier for the directory on IPFS. e.g. bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am

More info on CIDs: https://docs.ipfs.io/concepts/content-addressing/

url

The URL for the IPFS gateway to preview the content over https. e.g. https://bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am.ipfs.dweb.link

More info on IPFS Gateways: https://docs.ipfs.io/concepts/ipfs-gateway

Contribute

Feel free to dive in! Open an issue or submit PRs.

To contribute to IPFS in general, see the contributing guide.

License

MIT © Protocol Labs




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap