Initial commit
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
name: Send campaign
|
||||
on:
|
||||
# Pushing a tag like send/big-announcement is the primary trigger — a
|
||||
# deliberate, git-native, auditable action (git log --tags shows every
|
||||
# real send that ever happened). These are "command tags," not release
|
||||
# tags: fine to delete and re-push if a send needs retrying, since the
|
||||
# actual safety net is listmonk's own draft/paused status check in
|
||||
# `eec-campaigns send`, not tag uniqueness.
|
||||
push:
|
||||
tags: ["send/*"]
|
||||
# workflow_dispatch is kept alongside it for when clicking a button is
|
||||
# more convenient than a local `git tag && git push`. Same command either
|
||||
# way.
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
slug:
|
||||
description: "Campaign slug (campaigns/<slug>/) to send"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
send:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.23.1"
|
||||
|
||||
- name: Install eec-campaigns
|
||||
run: go install gitea.reground.org/will/eec-campaigns@v0.1.4
|
||||
|
||||
- name: Determine campaign slug
|
||||
id: slug
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
echo "value=${{ inputs.slug }}" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "value=${GITHUB_REF#refs/tags/send/}" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Send campaign
|
||||
run: eec-campaigns send "${{ steps.slug.outputs.value }}"
|
||||
env:
|
||||
LISTMONK_BASE_URL: ${{ secrets.CAMPAIGNS_LISTMONK_BASE_URL }}
|
||||
LISTMONK_API_USER: ${{ secrets.CAMPAIGNS_LISTMONK_API_USER }}
|
||||
LISTMONK_API_TOKEN: ${{ secrets.CAMPAIGNS_LISTMONK_API_TOKEN }}
|
||||
@@ -0,0 +1,25 @@
|
||||
name: Sync default campaign template
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
sync-template:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.23.1"
|
||||
|
||||
- name: Install eec-campaigns
|
||||
run: go install gitea.reground.org/will/eec-campaigns@v0.1.4
|
||||
|
||||
# TODO: rename "TEMPLATE default" below to "<this-repo-name> default"
|
||||
# (or any name you like) as part of customizing this template.
|
||||
- name: Sync template to listmonk
|
||||
run: eec-campaigns template "TEMPLATE default" email-templates/campaign.html
|
||||
env:
|
||||
LISTMONK_BASE_URL: ${{ secrets.CAMPAIGNS_LISTMONK_BASE_URL }}
|
||||
LISTMONK_API_USER: ${{ secrets.CAMPAIGNS_LISTMONK_API_USER }}
|
||||
LISTMONK_API_TOKEN: ${{ secrets.CAMPAIGNS_LISTMONK_API_TOKEN }}
|
||||
@@ -0,0 +1,25 @@
|
||||
name: Sync campaigns
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.23.1"
|
||||
|
||||
- name: Install eec-campaigns
|
||||
run: go install gitea.reground.org/will/eec-campaigns@v0.1.4
|
||||
|
||||
- name: Sync campaigns to listmonk
|
||||
run: eec-campaigns sync .
|
||||
env:
|
||||
LISTMONK_BASE_URL: ${{ secrets.CAMPAIGNS_LISTMONK_BASE_URL }}
|
||||
LISTMONK_API_USER: ${{ secrets.CAMPAIGNS_LISTMONK_API_USER }}
|
||||
LISTMONK_API_TOKEN: ${{ secrets.CAMPAIGNS_LISTMONK_API_TOKEN }}
|
||||
CAMPAIGNS_PREVIEW_EMAIL: ${{ secrets.CAMPAIGNS_PREVIEW_EMAIL }}
|
||||
@@ -0,0 +1,32 @@
|
||||
name: Test-send campaign
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
slug:
|
||||
description: "Campaign slug (campaigns/<slug>/) to preview"
|
||||
required: true
|
||||
type: string
|
||||
email:
|
||||
description: "Address to send the preview to"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.23.1"
|
||||
|
||||
- name: Install eec-campaigns
|
||||
run: go install gitea.reground.org/will/eec-campaigns@v0.1.4
|
||||
|
||||
- name: Send preview
|
||||
run: eec-campaigns test "${{ inputs.slug }}" "${{ inputs.email }}"
|
||||
env:
|
||||
LISTMONK_BASE_URL: ${{ secrets.CAMPAIGNS_LISTMONK_BASE_URL }}
|
||||
LISTMONK_API_USER: ${{ secrets.CAMPAIGNS_LISTMONK_API_USER }}
|
||||
LISTMONK_API_TOKEN: ${{ secrets.CAMPAIGNS_LISTMONK_API_TOKEN }}
|
||||
Reference in New Issue
Block a user