From a9390f76a9b7c4a8fcf7e01e28c85dad6e495d34 Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 12:33:46 +1000 Subject: [PATCH 01/14] initial jekyll build/deploy workflow --- .github/workflows/main.yml | 61 ++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9624e5928..c6546f65f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,15 +1,46 @@ -# name: Jekyll deploy - -# on: [push] - -# jobs: -# build_and_deploy: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v1 -# - name: Build & Deploy to GitHub Pages -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }} -# GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} -# uses: BryanSchuetz/jekyll-deploy-gh-pages@master +# References +# https://github.com/limjh16/jekyll-action-ts/blob/master/.github/workflows/workflow.yml + +name: Build and deploy Jekyll site + +on: + workflow_dispatch: + push: + branches: + - master + paths-ignore: + - .cache/** + - .github/** + - _drafts/** + - _draftsOldTumblr/** + - _writing/** + - README.md + - PUBLISHING.md + +jobs: + jekyll: + runs-on: ubuntu-latest + steps: + - name: 📂 checkout + uses: actions/checkout@v2 + + - name: 💎 setup ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + + - name: 🔨 install dependencies & build site + uses: limjh16/jekyll-action-ts@v2 + with: + enable_cache: true +# format_output: true + custom_opts: '--lsi' + +# - name: 🚀 deploy +# uses: peaceiris/actions-gh-pages@v3.6.4 +# with: +# github_token: ${{ secrets.GITHUB_TOKEN }} +# publish_dir: ./_site +# publish_branch: gh-pages +# commit_message: ${{ github.event.head_commit.message }} +# full_commit_message: ${{ github.event.head_commit.message }} From 7a78104c7ec88bfaa1ba7bf9913625e849f2222d Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 12:55:14 +1000 Subject: [PATCH 02/14] allow workflow to trigger from this branch for testing purposes --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c6546f65f..c4a522f41 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,9 +8,10 @@ on: push: branches: - master + - jekyll-build-deploy-workflow paths-ignore: - .cache/** - - .github/** + # - .github/** - _drafts/** - _draftsOldTumblr/** - _writing/** From dc2a10f3674d31302b160b78217bbe8a811f1b99 Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 13:12:06 +1000 Subject: [PATCH 03/14] install system dependencies required to compile native gems --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c4a522f41..65d3f6900 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,6 +30,9 @@ jobs: with: ruby-version: .ruby-version + - name: 🔨 install system dependencies + run: sudo apt-get install libgsl-dev + - name: 🔨 install dependencies & build site uses: limjh16/jekyll-action-ts@v2 with: From 6f229a6ab9e7e85c0e9cbe5a662f48cc2c3dbac6 Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 13:31:27 +1000 Subject: [PATCH 04/14] try removing nmatrix --- Gemfile | 2 +- Gemfile.lock | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 8a05e442b..71dc6c7ab 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,7 @@ gem 'jekyll','~>4.1.0' # https://github.com/0xdevalias/devalias.net/issues/83 # https://github.com/jekyll/classifier-reborn/issues/192 # https://github.com/SciRuby/rb-gsl/issues/63 -gem 'nmatrix' +#gem 'nmatrix' gem 'gsl' # Note: you need to install a compatible version (eg. 2.1) of gsl first: brew install gsl@2.1 gem 'classifier-reborn' diff --git a/Gemfile.lock b/Gemfile.lock index fc53bf238..f390550d8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,6 @@ GEM specs: addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - backports (3.18.1) classifier-reborn (2.2.0) fast-stemmer (~> 1.0) colorator (1.1.0) @@ -78,13 +77,9 @@ GEM rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.4.0) multipart-post (2.1.1) - nmatrix (0.2.4) - packable (~> 1.3, >= 1.3.5) octokit (4.18.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) - packable (1.3.14) - backports pathutil (0.16.2) forwardable-extended (~> 2.6) public_suffix (4.0.5) @@ -126,7 +121,6 @@ DEPENDENCIES jekyll-time-to-read jekyll-twitter-plugin jekyll_version_plugin - nmatrix BUNDLED WITH 2.1.4 From 0962d2353c6e66ec5aa4cde507f7ebafca7ca4ae Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 13:36:38 +1000 Subject: [PATCH 05/14] try removing gsl --- Gemfile | 2 +- Gemfile.lock | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 71dc6c7ab..47e09c532 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ gem 'jekyll','~>4.1.0' # https://github.com/jekyll/classifier-reborn/issues/192 # https://github.com/SciRuby/rb-gsl/issues/63 #gem 'nmatrix' -gem 'gsl' # Note: you need to install a compatible version (eg. 2.1) of gsl first: brew install gsl@2.1 +#gem 'gsl' # Note: you need to install a compatible version (eg. 2.1) of gsl first: brew install gsl@2.1 gem 'classifier-reborn' group :jekyll_plugins do diff --git a/Gemfile.lock b/Gemfile.lock index f390550d8..0fec1b626 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,6 @@ GEM fast-stemmer (1.0.2) ffi (1.13.1) forwardable-extended (2.6.0) - gsl (2.1.0.3) http_parser.rb (0.6.0) i18n (1.8.4) concurrent-ruby (~> 1.0) @@ -105,7 +104,6 @@ PLATFORMS DEPENDENCIES classifier-reborn - gsl jekyll (~> 4.1.0) jekyll-commonmark jekyll-compose From ce195f0fd24a2c15b11057cfefbc247c9fe70f89 Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 13:42:44 +1000 Subject: [PATCH 06/14] add jekyll --profile arg --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65d3f6900..2eb5eb260 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: with: enable_cache: true # format_output: true - custom_opts: '--lsi' + custom_opts: '--lsi --profile' # - name: 🚀 deploy # uses: peaceiris/actions-gh-pages@v3.6.4 From ba396ed9e3b014b00b9657d90916a5fadc59b9c3 Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 13:50:18 +1000 Subject: [PATCH 07/14] try without jekyll --lsi arg --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2eb5eb260..4a28382fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: with: enable_cache: true # format_output: true - custom_opts: '--lsi --profile' + custom_opts: '--profile' # - name: 🚀 deploy # uses: peaceiris/actions-gh-pages@v3.6.4 From e05b0b2e13ed2448384ae9886769f233e71f2a37 Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 14:13:03 +1000 Subject: [PATCH 08/14] restore --lsi option + gsl/nmatrix gems --- .github/workflows/main.yml | 2 +- Gemfile | 4 ++-- Gemfile.lock | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4a28382fe..2eb5eb260 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: with: enable_cache: true # format_output: true - custom_opts: '--profile' + custom_opts: '--lsi --profile' # - name: 🚀 deploy # uses: peaceiris/actions-gh-pages@v3.6.4 diff --git a/Gemfile b/Gemfile index 47e09c532..8a05e442b 100644 --- a/Gemfile +++ b/Gemfile @@ -11,8 +11,8 @@ gem 'jekyll','~>4.1.0' # https://github.com/0xdevalias/devalias.net/issues/83 # https://github.com/jekyll/classifier-reborn/issues/192 # https://github.com/SciRuby/rb-gsl/issues/63 -#gem 'nmatrix' -#gem 'gsl' # Note: you need to install a compatible version (eg. 2.1) of gsl first: brew install gsl@2.1 +gem 'nmatrix' +gem 'gsl' # Note: you need to install a compatible version (eg. 2.1) of gsl first: brew install gsl@2.1 gem 'classifier-reborn' group :jekyll_plugins do diff --git a/Gemfile.lock b/Gemfile.lock index 0fec1b626..fc53bf238 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,6 +3,7 @@ GEM specs: addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) + backports (3.18.1) classifier-reborn (2.2.0) fast-stemmer (~> 1.0) colorator (1.1.0) @@ -18,6 +19,7 @@ GEM fast-stemmer (1.0.2) ffi (1.13.1) forwardable-extended (2.6.0) + gsl (2.1.0.3) http_parser.rb (0.6.0) i18n (1.8.4) concurrent-ruby (~> 1.0) @@ -76,9 +78,13 @@ GEM rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.4.0) multipart-post (2.1.1) + nmatrix (0.2.4) + packable (~> 1.3, >= 1.3.5) octokit (4.18.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) + packable (1.3.14) + backports pathutil (0.16.2) forwardable-extended (~> 2.6) public_suffix (4.0.5) @@ -104,6 +110,7 @@ PLATFORMS DEPENDENCIES classifier-reborn + gsl jekyll (~> 4.1.0) jekyll-commonmark jekyll-compose @@ -119,6 +126,7 @@ DEPENDENCIES jekyll-time-to-read jekyll-twitter-plugin jekyll_version_plugin + nmatrix BUNDLED WITH 2.1.4 From 0f2c8828d06f71c15dc2098f72369fd7b2b2a75d Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 14:18:57 +1000 Subject: [PATCH 09/14] add JEKYLL_GITHUB_TOKEN env --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2eb5eb260..63c11bef3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,6 +39,8 @@ jobs: enable_cache: true # format_output: true custom_opts: '--lsi --profile' + env: + JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # - name: 🚀 deploy # uses: peaceiris/actions-gh-pages@v3.6.4 From fbd61d7572c2e67a85a7a1054ebe365b16f63d76 Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 14:35:41 +1000 Subject: [PATCH 10/14] use JEKYLL_GITHUB_TOKEN_PAT secret in JEKYLL_GITHUB_TOKEN env --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 63c11bef3..e047aded9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: # format_output: true custom_opts: '--lsi --profile' env: - JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + JEKYLL_GITHUB_TOKEN: ${{ secrets.JEKYLL_GITHUB_TOKEN_PAT }} # - name: 🚀 deploy # uses: peaceiris/actions-gh-pages@v3.6.4 From 41e8aadc6198788de2346d0988b443e91af84737 Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 14:44:33 +1000 Subject: [PATCH 11/14] add gh-pages deploy step to workflow with test branch --- .github/workflows/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e047aded9..0a64f7f23 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,11 +42,11 @@ jobs: env: JEKYLL_GITHUB_TOKEN: ${{ secrets.JEKYLL_GITHUB_TOKEN_PAT }} -# - name: 🚀 deploy -# uses: peaceiris/actions-gh-pages@v3.6.4 -# with: -# github_token: ${{ secrets.GITHUB_TOKEN }} -# publish_dir: ./_site -# publish_branch: gh-pages -# commit_message: ${{ github.event.head_commit.message }} -# full_commit_message: ${{ github.event.head_commit.message }} + - name: 🚀 deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_site + publish_branch: jekyll-build-deploy-workflow-gh-pages + # commit_message: ${{ github.event.head_commit.message }} + # full_commit_message: ${{ github.event.head_commit.message }} From 9e854b2ccc6e1b5bdec798fc1d0e28a11385d5bf Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 16:37:37 +1000 Subject: [PATCH 12/14] try storing current date in an output --- .github/workflows/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a64f7f23..b7ac3446f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,6 +33,13 @@ jobs: - name: 🔨 install system dependencies run: sudo apt-get install libgsl-dev + - id: currentdate + name: 📅 get current date and time + run: echo "::set-output name=date_str::$(date)" + + - name: 📅 check if date output was set correctly + run: echo ${{steps.currentdate.outputs.date_str}} + - name: 🔨 install dependencies & build site uses: limjh16/jekyll-action-ts@v2 with: From 68b59e9891bc09e21930989f286f17d4c03a46e0 Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 16:46:37 +1000 Subject: [PATCH 13/14] use current date output in site deploy commit message --- .github/workflows/main.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b7ac3446f..d9e365b8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,13 +33,6 @@ jobs: - name: 🔨 install system dependencies run: sudo apt-get install libgsl-dev - - id: currentdate - name: 📅 get current date and time - run: echo "::set-output name=date_str::$(date)" - - - name: 📅 check if date output was set correctly - run: echo ${{steps.currentdate.outputs.date_str}} - - name: 🔨 install dependencies & build site uses: limjh16/jekyll-action-ts@v2 with: @@ -49,11 +42,14 @@ jobs: env: JEKYLL_GITHUB_TOKEN: ${{ secrets.JEKYLL_GITHUB_TOKEN_PAT }} + - id: currentdate + name: 📅 get current date and time + run: echo "::set-output name=date_str::$(date)" + - name: 🚀 deploy uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./_site publish_branch: jekyll-build-deploy-workflow-gh-pages - # commit_message: ${{ github.event.head_commit.message }} - # full_commit_message: ${{ github.event.head_commit.message }} + commit_message: ${{ steps.currentdate.outputs.date_str }} From 605ee6b3bb61a4c12211b4e1906ea307c4ee26f7 Mon Sep 17 00:00:00 2001 From: Glenn 'devalias' Grant Date: Sun, 26 Jul 2020 16:51:00 +1000 Subject: [PATCH 14/14] improve site deploy commit message --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d9e365b8b..98d15dd15 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,4 +52,4 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./_site publish_branch: jekyll-build-deploy-workflow-gh-pages - commit_message: ${{ steps.currentdate.outputs.date_str }} + commit_message: "Update site: ${{ steps.currentdate.outputs.date_str }}"