Use GitHub Actions to create a serverless service.

Overview

ActionServerless - Use GitHub Actions to create a serverless service

ActionServerless Testing

ActionServerless is an action to do some computing and then generate a string/JSON file to a path, you can visit the file as a service when in dev/testing, or even in your production. We may take it as a GitHub Actions powered serverless service.

In fact you can do all of these in native GitHub actions. ActionServerless just wraps the steps to simplify the work:

  1. you can focus on coding the real logic, no need to care too much setup steps on the languages that ActionServerless supported(JS/Ruby/Python/Perl etc.). With a template we provide, you even don't bother to edit the action workflow configuration.
  2. use the route grammer we defined to specify a path to store the generated string/JSON file, that makes the job easy and clear.

Quick start

At first use the template to create a repository. Then We start with a Python example:

# function.py
import json

# GET /api/py_hello.json

print(json.dumps({"hello": "world"}))

put the file to a path(default is the root path of a repo, otherwise you need add the path as an argument to your actions configuaration), when you push the code the action will be triggered. Then the program's output is written to a file located in api/py_hello.json that you defined as a route in the comment.

more languages' examples you can find here.

Languages supported

Language Dependency Installation
Python requirements.txt
Ruby Gemfile
Node.js package.json
Perl cpanfile
Golang ⬜️ not supported yet
Haskell ⬜️ not supported yet
Elixir ⬜️ not supported yet
PHP ⬜️ not supported yet

HTTP Headers

If we'd like to be serious to take visiting such a GitHub raw file as a 'service', it's no problem for most situations as you request a normal HTTP service. But GitHub returns a text/html for any raw files it serves, that might lead to some bugs though I can't give an example yet.

So we provide a header rewrite service, which returns an application/json header for the json format files(those generated file suffixed with .json), and a text/plain header for the rest(those string or any text-based format files).

Header rewrite usage

Fox example, here's a raw url of the file:

https://raw.githubusercontent.com/gitx-io/ActionServerless/master/README.md

its corresponding header-rewritten url should be:

https://gitx.io/j/gitx-io/ActionServerless/master/README.md

just use gitx.io/j/ to replace the raw.githubusercontent.com/ segment.

Contributions

Contributions are welcome! You may check the following features in case you'd like to contribute but no idea what to do:

  • Support to add your favorite languages
  • Support dependency installation to the existing languages
  • Use this action to create an application and share it
You might also like...
A GitHub Actions repo for tracking the dummies sending free money to Alex Jones + co.

A GitHub Actions repo for tracking the dummies sending free money to Alex Jones + co.

Automation that uses Github Actions, Google Drive API, YouTube Data API and youtube-dl together to feed BackJam app with new music

Automation that uses Github Actions, Google Drive API, YouTube Data API and youtube-dl together to feed BackJam app with new music

42-event-notifier - 42 Event notifier using 42API and Github Actions
42-event-notifier - 42 Event notifier using 42API and Github Actions

42 Event Notifier 42서울 Agenda에 새로운 이벤트가 등록되면 알려드립니다! 현재는 Github Issue로 등록되므로 상단

GitHub Actions Docker training

GitHub-Actions-Docker-training Training exercise repository for GitHub Actions using a docker base. This repository should be cloned and used for trai

A discord.py bot template with easy deployment through Github Actions
A discord.py bot template with easy deployment through Github Actions

discord.py bot template A discord.py bot template with easy deployment through Github Actions. You can use this template to just run a Python instance

💻  A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline!
💻 A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline!

LocalStack - A fully functional local AWS cloud stack LocalStack provides an easy-to-use test/mocking framework for developing Cloud applications. Cur

SQS + Lambda를 활용한 문자 메시지 및 이메일, Voice call 호출을 간단하게 구현하는 serverless 템플릿
SQS + Lambda를 활용한 문자 메시지 및 이메일, Voice call 호출을 간단하게 구현하는 serverless 템플릿

AWS SQS With Lambda notification 서버 구축을 위한 Poc TODO serverless를 통해 sqs 관련 리소스(람다, sqs) 배포 가능한 템플릿 작성 및 배포 poc차원에서 간단한 rest api 호출을 통한 sqs fifo 큐에 메시지

A Serverless Application Model stack that persists the $XRP price to the XRPL every minute as a TrustLine. There are no servers, it is effectively a "smart contract" in Python for the XRPL.

xrpl-price-persist-oracle-sam This is a XRPL Oracle that publishes external data into the XRPL. This Oracle was inspired by XRPL-Labs/XRPL-Persist-Pri

Tools used by Ada Health's internal IT team to deploy and manage a serverless Munki setup.

Serverless Munki This repository contains cross platform code to deploy a production ready Munki service, complete with AutoPkg, that runs entirely fr

Comments
  • Add PHP support

    Add PHP support

    I feel like I've done something wrong here as this doesn't seem to work in my test repository, https://github.com/jbrooksuk/ActionServerlessPHP

    But it's a start!

    opened by jbrooksuk 5
  • This project (might) violate GitHub Terms of Service.

    This project (might) violate GitHub Terms of Service.

    See this: https://docs.github.com/en/github/site-policy/github-additional-product-terms#5-actions-and-packages

    Relevant info from the page:

    Actions and any elements of the Actions service may not be used in violation of the Agreement, the GitHub Acceptable Use Polices, or the GitHub Actions service limitations set forth in the Actions documentation. Additionally, Actions should not be used for:

    • cryptomining;
    • using our servers to disrupt, or to gain or to attempt to gain unauthorized access to, any service, device, data, account, or network (other than those authorized by the GitHub Bug Bounty program);
    • the provision of a stand-alone or integrated application or service offering Actions or any elements of Actions for commercial purposes;
    • any activity that places a burden on our servers, where that burden is disproportionate to the benefits provided to users (for example, don't use Actions as a content delivery network or as part of a serverless application, but a low benefit Action could be ok if it’s also low burden); or
    • any other activity unrelated to the production, testing, deployment, or publication of the software project associated with the repository where GitHub Actions are used.
    opened by ritabratamaiti 3
Releases(v2)
Modular Python-based Twitch bot optimized for customizability and ease of use.

rasbot Modular Python-based Twitch bot optimized for customizability and ease of use. rasbot is a Python-based Twitch bot that runs on your Twitch acc

raspy 9 Dec 14, 2022
Integrating the Daraja-Api with Python language

Mpesa-Daraja-Api Integrating the Daraja-Api with Python language. Credentials.py file This file contains the consumer key and the consumer secrete key

Morvin Ian 3 Nov 09, 2022
Pydapper - A pure python port of the NuGet library dapper

pydapper A pure python library inspired by the NuGet library dapper. pydapper is

Zach Schumacher 38 Jan 02, 2023
The official Python library for Shodan

shodan: The official Python library and CLI for Shodan Shodan is a search engine for Internet-connected devices. Google lets you search for websites,

John Matherly 2.1k Dec 31, 2022
troposphere - Python library to create AWS CloudFormation descriptions

troposphere - Python library to create AWS CloudFormation descriptions

4.8k Jan 06, 2023
Python library for Seeedstudio Grove devices

grove.py Python library for Seeedstudio Grove Devices on embeded Linux platform, especially good on below platforms: Coral Dev Board (Wiki) NVIDIA Jet

Seeed Studio 123 Dec 17, 2022
Python wrappers for INHECO ODTC and SCILA libraries by INHECO GmbH.

Python wrappers for INHECO ODTC and SCILA libraries by INHECO GmbH.

1 Feb 09, 2022
Seems Like Everyone Is Posting This, Thought I Should Too, Tokens Get Locked Upon Creation And Im Not Going To Fix For Several Reasons

Member-Booster Seems Like Everyone Is Posting This, Thought I Should Too, Tokens Get Locked Upon Creation And Im Not Going To Fix For Several Reasons

Mintyz 1 Dec 28, 2021
Policy and data administration, distribution, and real-time updates on top of Open Policy Agent

⚡ OPAL ⚡ Open Policy Administration Layer OPAL is an administration layer for Open Policy Agent (OPA), detecting changes to both policy and policy dat

8 Dec 07, 2022
Start multiple bots using one script. VK RAID BOTNET

MultiRaidBotnet Start multiple bots using one script. VK RAID BOTNET Русский launcher.py - главный скрипт, запускающий весь ботнет config.py - в нём х

2 Jul 22, 2022
A simple API Wrapper for Guilded.

Guildr A simple API Wrapper for Guilded. Frequently updated! I am not a user of Guilded, meaning I do not keep track of new Guilded updates or patches

2 Mar 07, 2022
Infinity: a Twitter retweet bot that can be used by anyone

INSTAMATE Requires Firefox Instapy Python3 How To Use? Fork the repository Add your credentials in the bot.py file Save commits Clone your fork cd int

unofficialdxnny 3 Jun 23, 2022
📅 Calendar file generator for triathlonlive.tv upcoming events

Triathlon Live Calendar Calendar file generator for triathlonlive.tv upcoming events. Install Requires Python 3.9.4 and Poetry. $ poetry install Runni

Eduardo Cuducos 4 Sep 02, 2022
Clubhouse API written in Python. Standalone client included. For reference and education purposes only.

clubhouse-py is originally developed for the sake of interoperability. Standalone client is also created with very basic features, including but not limited to the audio-chat

1.7k Jan 05, 2023
Desafio de projeto sobre Git/Github

Maçã ou Laranja? 🤔 Desafio Projeto Dio para Git/Github 🔶 Para esse primeiro repositório, decidir adicionar o primeiro algoritmo de inteligência arti

José Filipe 2 Oct 23, 2022
Validate all your Customer IAM Policies against AWS Access Analyzer - Policy Validation

✅ Access Analyzer - Batch Policy Validator This script will analyze using AWS Access Analyzer - Policy Validation all your account customer managed IA

Victor GRENU 41 Dec 12, 2022
A Python library for inserting an reverse shell attached to Telegram in any Python application.

py tel reverse shell the reverse shell in your telgram! What is this? This program is a Python library that you can use to put an inverted shell conne

Torham 12 Dec 28, 2022
Amanda-A next gen powerful telegram group manager bot for manage your groups and have fun with other cool modules.

Amanda-A next gen powerful telegram group manager bot for manage your groups and have fun with other cool modules.

Team Amanda 4 Oct 21, 2022
SOCMINT tool to get personal infos from an Instagram account via analysis of its followers and/or following

S T E R R A 🔭 A SOCMINT tool to get infos from an Instagram acc via its Followers / Following Allows you to analyse someone's followers, following, a

aet 316 Dec 28, 2022
Autofill HZDR Zeitman entries

Zeitman_autofill Filling out Zeitman is boring. This script might make some of the pain go away. Requirements The selenium package and Chrome webdrive

Tim Callow 8 Mar 14, 2022