Skip to content

Commit cd93a65

Browse files
Automation: Enable remote triggers via GitHub Actions
1 parent 24b0ae8 commit cd93a65

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Remote Publish to Reddit
2+
3+
on:
4+
# Allows manual triggering from any device (GitHub Web or App)
5+
workflow_dispatch:
6+
# Optional: Uncomment to publish automatically every time you push a new blog post
7+
# push:
8+
# paths:
9+
# - 'content/blog/**'
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
cache: 'npm'
26+
27+
- name: Install Dependencies
28+
run: npm install snoowrap dotenv gray-matter
29+
30+
- name: Run Auto-Publisher
31+
env:
32+
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }}
33+
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }}
34+
REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }}
35+
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }}
36+
REDDIT_SUBREDDITS: 'webdev,programming,javascript,sideproject'
37+
DOMAIN: 'https://wtkpro.site'
38+
run: node scripts/publish-reddit.mjs

0 commit comments

Comments
 (0)