Skip to content

Commit

Permalink
updated action dependencies to latest
Browse files Browse the repository at this point in the history
Also fixed the issue-deployment prompt not working
  • Loading branch information
Bullrich committed May 3, 2024
1 parent cf8be73 commit 2c9fd96
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 44 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
workflow_dispatch:
inputs:
post:
description: 'File name of the post to generate a share url'
description: "File name of the post to generate a share url"
required: false
type: string
title:
description: 'The title of the new story'
description: "The title of the new story"
required: false
type: string

Expand All @@ -23,17 +23,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- run: npm ci
- run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
- name: Deploy to GitHub Pages
Expand All @@ -50,7 +50,7 @@ jobs:
with:
rss: "https://storybot.dev/feed.xml"
- name: Publish on Reddit
uses: bluwy/release-for-reddit-action@v1
uses: bluwy/release-for-reddit-action@v2
with:
username: ${{ secrets.REDDIT_USERNAME }}
password: ${{ secrets.REDDIT_PASSWORD }}
Expand All @@ -62,15 +62,14 @@ jobs:
flair-id: ff8e376e-c33c-11ed-9958-c667e8d429b9
- name: Send toot to Mastodon
id: mastodon
uses: cbrgm/mastodon-github-action@v1
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"
env:
MASTODON_URL: ${{ secrets.MASTODON_URL }}
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
url: ${{ secrets.MASTODON_URL }}
- name: Publish on Twitter
uses: dart-actions/tweet@v1.0.0
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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ on:
jobs:
parse-prompt:
runs-on: ubuntu-latest
if: github.event.label.name == 'prompt-1'
if: github.event.label.name == 'generate-story'
permissions:
issues: read
contents: write
pull-requests: write
steps:
- name: Parse Issue Body
id: parse_prompt
uses: peter-murray/issue-forms-body-parser@v3.0.0
uses: peter-murray/issue-forms-body-parser@v4.1.0
with:
issue_id: ${{ github.event.issue.number }}
separator: '###'
label_marker_start: '✒️'
label_marker_end: '🖊️'
- uses: actions/checkout@v3
separator: "###"
label_marker_start: "✒️"
label_marker_end: "🖊️"
- uses: actions/checkout@v4
- name: Write Prompt to file
run: echo '${{ fromJson(steps.parse_prompt.outputs.payload).Prompt }}' > prompt.txt
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- run: npm ci
- name: Write story
id: write
Expand Down Expand Up @@ -58,4 +58,3 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
gh pr create --title "✍️ ${{ steps.write.outputs.title }}" --body-file body.txt
14 changes: 4 additions & 10 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ name: PR Check

on:
pull_request:
types: [
'opened',
'reopened',
'synchronize',
'assigned',
'labeled',
]
types: ["opened", "reopened", "synchronize", "assigned", "labeled"]

permissions:
contents: read
Expand All @@ -18,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- run: npm ci
- run: npm run build
20 changes: 9 additions & 11 deletions .github/workflows/prompt-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ jobs:
steps:
- name: Parse Issue Body
id: parse_prompt
uses: peter-murray/issue-forms-body-parser@v3.0.0
uses: peter-murray/issue-forms-body-parser@v4.1.0
with:
issue_id: ${{ github.event.issue.number }}
separator: '###'
label_marker_start: '_'
label_marker_end: '_'
- uses: actions/checkout@v3
separator: "###"
label_marker_start: "_"
label_marker_end: "_"
- uses: actions/checkout@v4
- name: Write story data
run: echo ${{ toJson(steps.parse_prompt.outputs.payload) }} > story.json
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- run: npm ci
- name: Build file
id: build
Expand All @@ -45,15 +45,15 @@ jobs:
git pull --rebase
git push --set-upstream origin main
deploy-site:
runs-on: ubuntu-latest
needs: [generate-story]
permissions:
actions: write
issues: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Deploy workflow
run: gh workflow run deploy-site.yml --field post="$URL" --field title="$TITLE"
env:
Expand All @@ -64,5 +64,3 @@ jobs:
run: gh issue close ${{ github.event.issue.number }} -r completed -c "Post released! Check it out in the [blog](https://storybot.dev/blog)!"
env:
GH_TOKEN: ${{ github.token }}


3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"start": "eleventy --serve --quiet",
"build": "NODE_ENV=production eleventy",
"write": "node scripts/content-creator.js",
"action": "node scripts/action.js"
"action": "node scripts/action.js",
"prompt": "node scripts/content-creator.js"
},
"author": "Javier Bullrich <javier@bullrich.dev>",
"license": "ISC",
Expand Down

0 comments on commit 2c9fd96

Please sign in to comment.