This repository has been archived by the owner on Feb 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (44 loc) · 1.32 KB
/
send.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Fetch blog posts and send draft
on:
push:
workflow_dispatch:
schedule:
- cron: '5 19 * * 1'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm ci
- name: Create env file
run: |
touch .env
echo BUTTONDOWN_EMAIL_TOKEN=${{ secrets.BUTTONDOWN_EMAIL_TOKEN }} >> .env
echo BLOG_NAME=${{ secrets.BLOG_NAME }} >> .env
echo EMAIL=${{ secrets.EMAIL }} >> .env
echo JSON_ENDPOINT=${{ secrets.JSON_ENDPOINT }} >> .env
echo POST_LIMIT=${{ secrets.POST_LIMIT }} >> .env
echo MASTODON_URL=${{ secrets.MASTODON_URL }} >> .env
- name: Fetch JSON
run: |-
npm run fetch
- name: Commit, push and send draft if changed
run: |-
git add .
git diff
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action Bot"
git commit -m "Send to buttondown.email" -a && npm run send || echo "No changes"
git push
- name: Delete env file
run: |
rm .env