giovannisciortino / giovannisciortino.github.io

0 stars 0 forks source link

2020-04-05-use_github_actions_to_create_jekyll_post_from_github_issue.md #9

Open giovannisciortino opened 4 years ago

giovannisciortino commented 4 years ago

title: "Use GitHub Actions to create Jekyll post from GitHub issue" tags: [github actions,jekyll]

This post describe a GitHub Actions workflow that allow to create new post on a Jekyll web site contained in a GitHub repository using the issue editor of GitHub website.

GitHub Actions [1] makes it easy to automate all your software workflows, it build, test, and deploy your code right from GitHub. Jekyll [2] is a simple, blog-aware, static site generator perfect for personal, project, or organization sites.

The article [3], describing the disadvantages of static site generator software compared to CMS software, includes among them the following "Publishing the site requires tools and code on your computer". The GitHub Actions workflow described in this post allows to mitigate this problem. This workflow allows to use the web interface of GitHub to create Jekyll posts exploiting the "MarkDown editor" and "check spelling" features contained in the issue editor of GitHub web site without require any tool installed.

The automation described in this post is contained in three files:

  1. A github issue template [4] containing a template of a new jekyll post file
  2. A github issue configuration file [5] that allow to create also github issue not respecting the template described in 1.
  3. A Github Workflow [6]

The GitHub workflow has been reported also below in order to describe its main components:

{% highlight YAML linenos %} name: A workflow to create a jekyll post from github issue on: issue_comment: types: [created] jobs: build: name: A job to create a jekyll post from github issue runs-on: ubuntu-latest if: github.event.comment.body == 'publish' steps:

This GitHub workflow contains the following main elements:

These three files allow to implement the workflow described in this post. The automation described in this post has been used to create this post itself, [7] is the GitHub issue used to create this post.

[1] https://github.com/features/actions

[2] https://jekyllrb.com/

[3] https://www.strattic.com/jekyll-hugo-wordpress-pros-cons-static-site-generators/

[4] https://github.com/giovannisciortino/giovannisciortino.github.io/blob/master/.github/ISSUE_TEMPLATE/jekill_post_new_template.md

[5] https://github.com/giovannisciortino/giovannisciortino.github.io/blob/master/.github/ISSUE_TEMPLATE/config.yml

[6] https://github.com/giovannisciortino/giovannisciortino.github.io/blob/master/.github/workflows/create_jekyll_post_from_issue.yamlhttps://raw.githubusercontent.com/giovannisciortino/giovannisciortino.github.io/master/.github/workflows/create_jekyll_post_from_issue.yaml

giovannisciortino commented 4 years ago

publish

giovannisciortino commented 4 years ago

publish

giovannisciortino commented 4 years ago

publish

giovannisciortino commented 4 years ago

publish

giovannisciortino commented 4 years ago

publish

giovannisciortino commented 4 years ago

publish