Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
globe

GitHub Action

Create static redbean server

v1.0.0

Create static redbean server

globe

Create static redbean server

Create a single-file cross-platform server within an executable ZIP, powered by redbean 🦞

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Create static redbean server

uses: TimonLukas/[email protected]

Learn more about this action in TimonLukas/action-static-redbean

Choose a version

Create static server executable - powered by redbean 🦞

This GitHub action creates a single-file server that:

Usage

- uses: TimonLukas/action-static-redbean@v1
  with:
    # specifies version to be fetched from redbean.dev
    version: "latest"
    # Location of the finished executable
    executable-name: "redbean.com"
    # Location of static files to include
    input: "dist"
    # Fallback file (for history API-based routing), `false` to disable
    fallback: "index.html"
    

# Example: static server for `./build/*` without fallback using redbean version x.y.z
- uses: TimonLukas/action-static-redbean@v1
  with:
    version: "x.y.z"
    input: "build"
    fallback: false
- run: mv ./redbean.com $FOO

Extending behavior

Generally, anything beyond serving files statically can be approached using the LUA api. The fallback option itself is actually implemented as:

function OnHttpRequest()
    if not RoutePath() then
        ServeAsset('$FALLBACK')
    end
end

To add any behavior, add .init.lua with your own content into your input directory. Depending on your project it might be worth to look into frameworks for redbean like fullmoon.