Monthly Album Digest #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Monthly Album Digest | |
description: Creates an album digest from last month, and send it to my email. | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 * *' | |
jobs: | |
monthly-album-digest: | |
runs-on: ubuntu-latest | |
environment: deployment | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- id: stack | |
uses: freckle/stack-action@v5 | |
with: | |
stack-build-arguments: --fast # No pedantic for now | |
- id: run | |
name: Run | |
run: | | |
echo 'text<<EOF' >> $GITHUB_OUTPUT | |
stack exec monthly-rewind >> $GITHUB_OUTPUT | |
echo 'EOF' >> $GITHUB_OUTPUT | |
- name: Send email via Mailgun | |
id: send_email | |
run: | | |
TEXT="${{ steps.run.outputs.text }}" | |
curl -s --user "api:${{ secrets.MAILGUN_API_KEY }}" \ | |
https://api.mailgun.net/v3/${{ secrets.MAILGUN_SERVER }}/messages \ | |
-F from="Mailgun Sandbox <postmaster@${{ secrets.MAILGUN_SERVER }}>" \ | |
-F to="Tsung-Ju Lii <usefulalgorithm@gmail.com>" \ | |
-F subject="Monthly Digest" \ | |
--data-urlencode text="$TEXT" |