Skip to content

Deploying with GitHub Actions

This article shows you how to set up GitHub Actions to check your Email Design System (EDS) when a pull request is opened, and deploy it to EmailShepherd when the pull request is merged.

Keeping your EDS in Git means changes can be reviewed before they reach your emails. With these workflows, nothing is deployed until it’s been checked and merged.

  • Set up a repository for your EDS and push it to GitHub. See The EDS SDK.
  • Find your workspace ID and EDS ID. They’re in the .env file in your repository, as EMAILSHEPHERD_WORKSPACE_ID and EMAILSHEPHERD_EDS_ID.
  1. Create an API key with the Email design systems: Read and Write and Workspaces: Read scopes. See How to create an API key.
  2. In your GitHub repository, add it as a repository secret called EMAILSHEPHERD_API_KEY.

Create .github/workflows/validate.yml with the following, replacing the workspace and EDS IDs with your own:

name: Validate EDS
on:
pull_request:
branches:
- main
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Validate EDS
run: npx emailshepherd validate
env:
EMAILSHEPHERD_WORKSPACE_ID: 'your-workspace-id'
EMAILSHEPHERD_EDS_ID: 'your-email-design-system-id'
EMAILSHEPHERD_API_KEY: ${{ secrets.EMAILSHEPHERD_API_KEY }}

Every pull request to main is now checked for errors.

Create .github/workflows/deploy.yml:

name: Deploy EDS
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Validate EDS
run: npx emailshepherd validate
env:
EMAILSHEPHERD_WORKSPACE_ID: 'your-workspace-id'
EMAILSHEPHERD_EDS_ID: 'your-email-design-system-id'
EMAILSHEPHERD_API_KEY: ${{ secrets.EMAILSHEPHERD_API_KEY }}
- name: Deploy EDS
run: npx emailshepherd deploy
env:
EMAILSHEPHERD_WORKSPACE_ID: 'your-workspace-id'
EMAILSHEPHERD_EDS_ID: 'your-email-design-system-id'
EMAILSHEPHERD_API_KEY: ${{ secrets.EMAILSHEPHERD_API_KEY }}

When changes are merged into main, the EDS is checked again and then deployed. See Deploy your changes for what deploying does.