Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/create-draft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: create draft

on:
workflow_dispatch:
inputs:
title:
description: "Title"
required: true

defaults:
run:
working-directory: blog

jobs:
create-draft:
uses: hatena/hatenablog-workflows/.github/workflows/create-draft.yaml@v1
with:
title: ${{ github.event.inputs.title }}
BLOG_DOMAIN: ${{ vars.BLOG_DOMAIN }}
secrets:
OWNER_API_KEY: ${{ secrets.OWNER_API_KEY }}
22 changes: 22 additions & 0 deletions .github/workflows/initialize.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: initialize

on:
workflow_dispatch:
inputs:
is_draft_included:
description: "同期対象に下書きを含める(未公開の記事が commit されます)"
required: true
type: boolean

defaults:
run:
working-directory: blog

jobs:
initialize:
uses: hatena/hatenablog-workflows/.github/workflows/initialize.yaml@v1
with:
is_draft_included: ${{ inputs.is_draft_included }}
BLOG_DOMAIN: ${{ vars.BLOG_DOMAIN }}
secrets:
OWNER_API_KEY: ${{ secrets.OWNER_API_KEY }}
21 changes: 21 additions & 0 deletions .github/workflows/pull-draft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: pull draft from hatenablog

on:
workflow_dispatch:
inputs:
title:
description: "Draft Entry Title"
required: true

defaults:
run:
working-directory: blog

jobs:
pull-draft:
uses: hatena/hatenablog-workflows/.github/workflows/pull-draft.yaml@v1
with:
title: ${{ github.event.inputs.title }}
BLOG_DOMAIN: ${{ vars.BLOG_DOMAIN }}
secrets:
OWNER_API_KEY: ${{ secrets.OWNER_API_KEY }}
16 changes: 16 additions & 0 deletions .github/workflows/pull.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pull from hatenablog

on:
workflow_dispatch:

defaults:
run:
working-directory: blog

jobs:
pull:
uses: hatena/hatenablog-workflows/.github/workflows/pull.yaml@v1
with:
BLOG_DOMAIN: ${{ vars.BLOG_DOMAIN }}
secrets:
OWNER_API_KEY: ${{ secrets.OWNER_API_KEY }}
16 changes: 16 additions & 0 deletions .github/workflows/push-draft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: push draft to hatena blog

on:
pull_request:
paths:
- "blog/draft_entries/**"

defaults:
run:
working-directory: blog

jobs:
push-draft:
uses: hatena/hatenablog-workflows/.github/workflows/push-draft.yaml@v1
secrets:
OWNER_API_KEY: ${{ secrets.OWNER_API_KEY }}
17 changes: 17 additions & 0 deletions .github/workflows/push-published-entries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: push published entries


on:
pull_request:
paths:
- "blog/entries/**"

defaults:
run:
working-directory: blog

jobs:
push-published-entries:
uses: hatena/hatenablog-workflows/.github/workflows/push-published-entries.yaml@v1
secrets:
OWNER_API_KEY: ${{ secrets.OWNER_API_KEY }}
21 changes: 21 additions & 0 deletions .github/workflows/push-when-publishing-from-draft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: push when publishing from draft

on:
pull_request:
branches:
- main
types: [closed]
paths:
- "blog/draft_entries/**"

defaults:
run:
working-directory: blog

jobs:
push-when-publishing-from-draft:
uses: hatena/hatenablog-workflows/.github/workflows/push-when-publishing-from-draft.yaml@v1
with:
BLOG_DOMAIN: ${{ vars.BLOG_DOMAIN }}
secrets:
OWNER_API_KEY: ${{ secrets.OWNER_API_KEY }}
21 changes: 21 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: push to hatena blog

on:
pull_request:
branches:
- main
types: [closed]
paths:
- "blog/entries/**"

defaults:
run:
working-directory: blog

jobs:
push:
uses: hatena/hatenablog-workflows/.github/workflows/push.yaml@v1
with:
local_root: "entries"
secrets:
OWNER_API_KEY: ${{ secrets.OWNER_API_KEY }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/node_modules

/dist
/blog/draft
6 changes: 4 additions & 2 deletions blog/blogsync.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lufia.hateblo.jp:
local_root: .
omit_domain: true
username: lufiabb

default:
local_root: entries
4 changes: 4 additions & 0 deletions blog/draft.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
Title: ${TITLE}
Draft: true
---
Empty file added blog/draft_entries/.gitkeep
Empty file.
Empty file added blog/entries/.gitkeep
Empty file.