Skip to content

Deploy page

Deploy page #260

Workflow file for this run

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@v3
- name: Install node
uses: actions/setup-node@v2
with:
node-version: 18
- run: npm ci
- run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
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@v1
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@v1
with:
message: "I wrote a new #AI post. Read it at ${{ steps.rss.outputs.url }}"
visibility: "public"
env:
MASTODON_URL: ${{ secrets.MASTODON_URL }}
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
- name: Publish on Twitter
uses: dart-actions/tweet@v1.0.0
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 }}