Skip to content

Commit 88600d7

Browse files
feat: run it in a workflow
Signed-off-by: Tsung-Ju Lii <usefulalgorithm@gmail.com>
1 parent 0f257ac commit 88600d7

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Monthly Album Digest
2+
description: Creates an album digest from last month, and send it to my email.
3+
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '0 0 1 * *'
8+
jobs:
9+
create-branch-and-pr:
10+
runs-on: ubuntu-latest
11+
environment: deployment
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- id: stack
18+
uses: freckle/stack-action@v5
19+
with:
20+
stack-build-arguments: --fast # No pedantic for now
21+
22+
- id: run
23+
run: echo "text=$(stack exec monthly-rewind)"" >> $GITHUB_OUTPUT
24+
25+
- name: Send Email
26+
run: |
27+
curl -s --user 'api:${{ secrets.MAILGUN_API_KEY }}' \
28+
https://api.mailgun.net/v3/${{ secrets.MAILGUN_SERVER }}/messages \
29+
-F from='Mailgun Sandbox <postmaster@${{ secrets.MAILGUN_SERVER }}>' \
30+
-F to='Tsung-Ju Lii <usefulalgorithm@gmail.com>' \
31+
-F subject='Monthly Digest' \
32+
-F text='${{ steps.run.outputs.text }}'
33+

0 commit comments

Comments
 (0)