Giter Site home page Giter Site logo

beeload-action's Introduction

Beeload Action (deprecated)

⚠️ Beeload action is deprecated in favor of more flexible set of actions Swarm Actions.

standard-readme compliant

Toolkit for uploading data to Swarm network with GitHub Actions

Warning: This project is in beta state. There might (and most probably will) be changes in the future to its API and working. Also, no guarantees can be made about its stability, efficiency, and security at this stage.

This project is intended to be used with Bee version 1.4.1-238867f1. Using it with older or newer Bee versions is not recommended and may not work. Stay up to date by joining the official Discord and by keeping an eye on the releases tab.

Table of Contents

Usage

Sending latest master built to Mattermost

name: Send `master` built link to Mattermost

on:
  push:
    branches:
      - 'master'

jobs:
  check:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Use Node.js 16
        uses: actions/setup-node@v1
        with:
          node-version: '16'

      - name: Install dependencies
        run: npm ci

      # Build process puts the built files into `./build` folder
      - name: Build
        run: npm run build

      # Upload the build folder to Swarm
      - name: Create preview
        id: upload
        uses: ethersphere/beeload-action@master
        with:
          bee-url: https://bee-9.gateway.ethswarm.org # We are using Gateway node that allows small sized files/sites to be uploaded
          postage-batch-id: '0000000000000000000000000000000000000000000000000000000000000000' # Postage Stamps are replaced on Gateway, so we are using dummy string to pass input validations
          token: ${{ secrets.REPO_GHA_PAT }}
          dir: ./build

      # Send notification to Mattermost channel
      - name: Create the Mattermost Message
        run: |
          echo "{\"text\":\"Preview of PR :tada:: ${{ steps.upload.outpus.preview-url }}\"}" > mattermost.json
      - uses: mattermost/action-mattermost-notify@master
        env:
          MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}

PR preview

name: PR preview

on:
  pull_request:
    branches:
      - '**'

jobs:
  check:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Use Node.js 16
        uses: actions/setup-node@v1
        with:
          node-version: '16'

      - name: Install dependencies
        run: npm ci

      # Build process puts the built files into `./build` folder
      - name: Build
        run: npm run build

      # Upload the build folder to Swarm
      - name: Create preview
        uses: ethersphere/beeload-action@master
        with:
          bee-url: https://bee-9.gateway.ethswarm.org # We are using Gateway node that allows small sized files/sites to be uploaded
          postage-batch-id: '0000000000000000000000000000000000000000000000000000000000000000' # Postage Stamps are replaced on Gateway, so we are using dummy string to pass input validations
          preview: true
          token: ${{ secrets.REPO_GHA_PAT }}
          dir: ./build

Action inputs

Name Description Default
bee-url URL of Bee API of your Bee node
bzz-link-url URL of Bzz.link. It has to contain <<CID>> string, which will be replaced with the CID of the content https://<<CID>>.bzz.link
postage-batch-id Batch ID of Postage Stamp that will be used for upload
dir Folder that contains the built webpage ./build
token Token to be used for creating of the PR Preview comment. GITHUB_TOKEN
preview Flag that enables creating PR Preview comment. false
extra-params Extra parameters that you will be passed to swarm-cli calls.

Action outputs

Name Description
swarm-hash Swarm hash of the uploaded content
bzz-link Bzz Link URL

Contribute

There are some ways you can make this module better:

  • Consult our open issues and take on one of them
  • Help our tests reach 100% coverage!
  • Join us in our Discord chat in the #develop-on-swarm channel if you have questions or want to give feedback

Maintainers

See what "Maintainer" means here.

License

BSD-3-Clause

beeload-action's People

Contributors

agazso avatar auhau avatar bee-worker avatar dependabot[bot] avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beeload-action's Issues

Add support for feeds

In order to be able to deploy production websites to Swarm, it would be easy useful for this action to support feeds.

This could be done either by conditionally replacing swarm-cli upload with swarm-cli feed upload and adding inputs for:

  • topic
  • topic-string
  • identity

Or adding a separate action that runs swarm-cli feed update.

What would be your preference? I'd be happy to write a PR. 🙂

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.