Deploy page #496
This file contains 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: Deploy page | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
inputs: | |
post: | |
description: "File name of the post to generate a share url" | |
required: false | |
type: string | |
title: | |
description: "The title of the new story" | |
required: false | |
type: string | |
permissions: | |
pages: write | |
id-token: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: npm ci | |
- run: npm run build | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
publish: | |
needs: [deploy] | |
runs-on: ubuntu-latest | |
if: inputs.post != '' | |
steps: | |
- name: Fetch Post Data | |
id: rss | |
uses: CodingBull-dev/newest-rss-post-action@main | |
with: | |
rss: "https://storybot.dev/feed.xml" | |
- name: Publish on Reddit | |
uses: bluwy/release-for-reddit-action@v2 | |
with: | |
username: ${{ secrets.REDDIT_USERNAME }} | |
password: ${{ secrets.REDDIT_PASSWORD }} | |
app-id: ${{ secrets.REDDIT_APP_ID }} | |
app-secret: ${{ secrets.REDDIT_APP_SECRET }} | |
subreddit: StoryBotDev | |
title: ${{ steps.rss.outputs.title }} | |
url: ${{ steps.rss.outputs.url }} | |
flair-id: ff8e376e-c33c-11ed-9958-c667e8d429b9 | |
- name: Send toot to Mastodon | |
id: mastodon | |
uses: cbrgm/mastodon-github-action@v2.0.6 | |
with: | |
message: "I wrote a new #AI post. Read it at ${{ steps.rss.outputs.url }}" | |
visibility: "public" | |
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} | |
url: ${{ secrets.MASTODON_URL }} | |
- name: Publish on Twitter | |
uses: dart-actions/tweet@v1.0.1 | |
with: | |
text: "I wrote a new #AI post using #OpenAI. Read it at ${{ steps.rss.outputs.url }}" | |
consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }} | |
consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} | |
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} | |
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} |