-
Notifications
You must be signed in to change notification settings - Fork 22
52 lines (45 loc) · 1.39 KB
/
update_medium.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
49
50
51
52
name: Trigger medium publish if new post
on:
push:
paths:
- "blog/**"
branches:
- master
jobs:
build:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
- uses: jitterbit/get-changed-files@v1
id: added_files
with:
format: space-delimited
token: ${{ secrets.GITHUB_TOKEN }}
- name: Printing
run: |
echo "All:"
echo "${{ steps.added_files.outputs.all }}"
echo "Added:"
echo "${{ steps.added_files.outputs.added }}"
echo "Removed:"
echo "${{ steps.added_files.outputs.removed }}"
echo "Renamed:"
echo "${{ steps.added_files.outputs.renamed }}"
echo "Modified:"
echo "${{ steps.added_files.outputs.modified }}"
echo "Added+Modified:"
echo "${{ steps.added_files.outputs.added_modified }}"
- name: Post new blog to medium
if: ${{ steps.added_files.outputs.added }}
env:
MEDIUM_ID: ${{secrets.MEDIUM_ID}}
MEDIUM_PUBLICATION_ID: ${{secrets.MEDIUM_PUBLICATION_ID}}
MEDIUM_TOKEN: ${{secrets.MEDIUM_TOKEN}}
FILES: ${{ steps.added_files.outputs.added }}
run: |
mv postMedium.md postMedium.js
yarn
node postMedium.js $FILES