Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

neobrains/space-pipe

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Space Pipe

A simple GitHub Action to deploy your projects to Deta Space and let their builder build your apps.

Thanks for the help ✨ Sponge.

Usage

  • Push your changes to create a new revision of your app.
  • Release your latest revision. Each release can either be unlisted, where only people with the link can install it, or listed, which makes a release available for anyone to discover and install with Deta Discovery.

Inputs

  • access_token : Used for Space CLI authentication. From Deta Space Dashboard, open the teletype (command bar) and click on Settings. In the settings modal, click on Generate Token to generate an access token and copy the resulting access token.

  • project_id : Used for getting the .space folder for pushing your code to Deta Space. To get your project id go to the Builder and in your project’s Develop tab, open the teletype (command bar) and copy the Project ID.

  • project_directory : (Optional) The directory where your project is located. The default value is the root directory.

  • space_push : (Optional) If true, pushes your changes to Space and creates a new revision. The default value is false.

  • experimental : (Optional) If true, uses Deta Space's experimental runner. The default value is false.

  • space_release : (Optional) If true, the latest revision will be released to Space. The default value is false.

  • list_on_discovery : (Optional) If true, the latest revision will be listed on Space Discovery. The default value is false.

  • release_version : (Optional) Version for the release. If not provided, Deta Space will generate a version by default.


⚠️ Neither list_on_discovery nor release_version can be used without space_release set to "true" as both of them are optional args of space_release.

⚠️ Use GitHub Actions secrets to store your inputs.

⚠️ Make sure to add your 📝Spacefile in your repository. It contains the configuration of your project and is used by Deta Space to understand what your project looks like and how to run it.

Example workflow

name: Push to Space
on: push

jobs:
  push-to-space:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Deta Space Deployment Github Action
        uses: neobrains/space-pipe@v0.5
        with:
          access_token: ${{ secrets.ACCESS_TOKEN }}
          project_id: ${{ secrets.PROJECT_ID }}
          space_push: true
          list_on_discovery: true

Here access_token and project_id are stored as ACCESS_TOKEN and PROJECT_ID in GitHub Actions secrets. After creating a new revision with space_push, the latest revision will be listed on Space Discovery with list_on_discovery.

Some workflow examples to manage your deployments:

  • A single workflow can be created with jobs to do space push, release of that revision and list that on Space Discovery with conditions to run a subsequent job if the previous one was successful.

  • A workflow with space_push can be set up to run on each push to the workflow's repository. Separate workflows for space_release and list_on_discovery can be set up to run on workflow_dispatch to be executed when needed.

  • Configure your workflow to do space_push on each push to devlopment branch, space_release on each push to test branch and list_on_discovery on each push to main or master branch.

License

This GitHub Action and associated documentation in this project are released under the MIT License.