Skip to content

Automate deployments of your formspree.json configurations with Formspree CLI and GitHub actions

License

Notifications You must be signed in to change notification settings

formspree/cli-action

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

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Formspree CLI GitHub Action

⚡️ Automate your Formspree deployment using the Formspree CLI with GitHub Actions.

Usage

Create a new file /.github/workflows/formspree.yml with the following:

name: Formspree Deployment

on:
  push:
    branches:
    - main

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Deploy
      uses: formspree/cli-action@main
      with:
        deployKey: ${{ secrets.FORMSPREE_DEPLOY_KEY }}

Authentication

To use the Formspree CLI, you need to create a CLI project.

Once you have created a project on the dashboard, you'll receive a deploy key. You'll want to add this to GitHub's secrets. In your repository, go to Settings -> Secrets and add your deploy key. GitHub encrypts this token, and it won't be printed in the logs, so even for a public repository it won't be accessible to the world.

We need to include the authentication information in the with block of the action. If you've named the secret, FORMSPREE_DEPLOY_KEY, it would look like:

jobs:
  deploy:
    steps:
      uses: formspree/cli-action@main
      with:
        deployKey: ${{ secrets.FORMSPREE_DEPLOY_KEY }}

FAQ

Why do I need this?

If you are using the Formspree CLI, use our quick start guide. Once you're ready to push your site live, you might want to automatically deploy new forms as you change the project. Using this action, you can configure your site without ever leaving your terminal.

My forms aren't showing up on my dashboard

First, look at the GitHub Actions logs and see if there's an error. If you still can't find anything, open a ticket with our support team and we'd be happy to look into it.