-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (61 loc) · 2.22 KB
/
transform-feed.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: transform-feed
on:
issue_comment:
types: [created]
repository_dispatch:
types: [build]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Validate comment and issue number
if: ${{ github.event.comment.body != 'build' || github.event.issue.number != 1 }}
run: make phony-error
- name: Add start reaction
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ github.event.comment.id }}
reactions: eyes
- name: Install deps
run: make install
- name: Fetch and parse feed
run: make feed username=${{ secrets.ANCHOR_USERNAME }} site-base=${{ secrets.SITE_BASE }}
- name: Feed to json
run: make transform
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "Github Actions"
rm -rf Makefile bin tmp ops *.clj *.md .github
git add public/*
git commit -am ":loudspeaker: Feed update requested by ${{ github.event.comment.user.login }}" || echo "No new updates".
- name: Push changes
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
- name: Add success reaction
uses: peter-evans/create-or-update-comment@v1
if: ${{ success() }}
with:
comment-id: ${{ github.event.comment.id }}
reactions: heart
- name: Add generic fail reaction
uses: peter-evans/create-or-update-comment@v1
# Send fail responses only on issue number 1
if: ${{ failure() && github.event.issue.number == 1 }}
with:
comment-id: ${{ github.event.comment.id }}
reactions: -1
- name: Create error comment
uses: peter-evans/create-or-update-comment@v1
if: ${{ failure() && github.event.issue.number == 1 }}
with:
issue-number: 1
body: |
🤖
I was not able to build the feed. It could be due to multiple reasons:
- Make sure the required secrets: **ANCHOR_USERNAME** and **SITE_BASE** are present
- Check the actions pane for any error
- Read docs or raise an issue