From ef1e3a79c0fd0bd93185745155c7bed4845504ea Mon Sep 17 00:00:00 2001 From: KW Kwan Date: Thu, 14 Dec 2023 13:18:43 +0800 Subject: [PATCH 1/3] Migrate site to Github Pages --- .bundle/config | 2 + .github/workflows/build_deploy.yml | 81 ++++++++++++++++++++++++++++++ .gitignore | 1 - Gemfile | 2 + Gemfile.lock | 5 +- _config.yml | 6 +-- parent-hub/assets/symbol.svg | 3 ++ parent-hub/title.html | 37 ++++++++++++++ 8 files changed, 131 insertions(+), 6 deletions(-) create mode 100644 .bundle/config create mode 100644 .github/workflows/build_deploy.yml create mode 100644 parent-hub/assets/symbol.svg create mode 100644 parent-hub/title.html diff --git a/.bundle/config b/.bundle/config new file mode 100644 index 0000000..5d906f2 --- /dev/null +++ b/.bundle/config @@ -0,0 +1,2 @@ +--- +BUNDLE_BUILD__NOKOGIRI: "--use-system-libraries" diff --git a/.github/workflows/build_deploy.yml b/.github/workflows/build_deploy.yml new file mode 100644 index 0000000..4a6bfd4 --- /dev/null +++ b/.github/workflows/build_deploy.yml @@ -0,0 +1,81 @@ +name: build_deploy + +on: + push: + branches: + - main + # - staging + pull_request: + repository_dispatch: + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + # set_environment: + # outputs: + # my_env: ${{ steps.setenv.outputs.my_env }} + # my_url: ${{ steps.setenv.outputs.my_url }} + # runs-on: ubuntu-latest + # steps: + # - id: setenv + # run: | + # if [ "$GITHUB_REF" = "refs/heads/main" ] + # then + # echo "::set-output name=my_env::production" + # echo "::set-output name=my_url::https://www.tebako.org" + # elif [ "$GITHUB_REF" = "refs/heads/staging" ] + # then + # echo "::set-output name=my_env::staging" + # echo "::set-output name=my_url::https://staging-www.tebako.org" + # fi + + build: + runs-on: ubuntu-latest + # needs: [set_environment] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + cache-version: 0 # Increment this number if you need to re-download cached gems + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + + - name: Build with Jekyll + # Outputs to the './_site' directory by default + run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" + env: + JEKYLL_ENV: production + + - name: Upload artifact + # Automatically uploads an artifact from the './_site' directory by default + uses: actions/upload-pages-artifact@v2 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.gitignore b/.gitignore index 3e1f2ba..b2e9a3a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ _software/*/docs _software/_*_repo _specs/*/.git _specs/*/docs -parent-hub/* _site .sass-cache .jekyll-cache/ diff --git a/Gemfile b/Gemfile index 4fdff00..ead515a 100644 --- a/Gemfile +++ b/Gemfile @@ -35,3 +35,5 @@ gem "wdm", "~> 0.1.0" if Gem.win_platform? # For testing generated HTML pages and links gem "rake" gem "html-proofer" + +gem "ffi", "~> 1.16.3" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index aa8376d..eff23ba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,7 +19,7 @@ GEM ffi (>= 1.3.0) eventmachine (1.2.7) fastimage (2.1.5) - ffi (1.9.25) + ffi (1.16.3) forwardable-extended (2.6.0) git (1.5.0) html-proofer (3.9.1) @@ -106,6 +106,7 @@ PLATFORMS ruby DEPENDENCIES + ffi (~> 1.16.3) git html-proofer jekyll (~> 3.8.3) @@ -118,4 +119,4 @@ DEPENDENCIES tzinfo-data BUNDLED WITH - 2.0.1 + 2.4.21 diff --git a/_config.yml b/_config.yml index 783d81d..9d540e5 100644 --- a/_config.yml +++ b/_config.yml @@ -15,9 +15,9 @@ legal: tos_link: https://www.ribose.com/tos privacy_policy_link: https://www.ribose.com/privacy -parent_hub: - git_repo_url: https://github.com/riboseinc/open.ribose.com - home_url: https://open.ribose.com/ +# parent_hub: +# git_repo_url: https://github.com/riboseinc/open.ribose.com +# home_url: https://open.ribose.com/ # These are required for the theme to work: diff --git a/parent-hub/assets/symbol.svg b/parent-hub/assets/symbol.svg new file mode 100644 index 0000000..f09d559 --- /dev/null +++ b/parent-hub/assets/symbol.svg @@ -0,0 +1,3 @@ + + + diff --git a/parent-hub/title.html b/parent-hub/title.html new file mode 100644 index 0000000..c4eed50 --- /dev/null +++ b/parent-hub/title.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 7492263c44e3d6101ad8d44911c14d8e598232e8 Mon Sep 17 00:00:00 2001 From: KW Kwan Date: Thu, 14 Dec 2023 13:53:39 +0800 Subject: [PATCH 2/3] Set ruby version --- .github/workflows/build_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_deploy.yml b/.github/workflows/build_deploy.yml index 4a6bfd4..f57d7ad 100644 --- a/.github/workflows/build_deploy.yml +++ b/.github/workflows/build_deploy.yml @@ -50,7 +50,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.1' + ruby-version: '2.7' bundler-cache: true cache-version: 0 # Increment this number if you need to re-download cached gems - name: Setup Pages From 4993dfea838b61a6bfd88e2fa46a8fa7abbf7709 Mon Sep 17 00:00:00 2001 From: KW Kwan Date: Thu, 14 Dec 2023 15:38:12 +0800 Subject: [PATCH 3/3] Add step to install missing libraries --- .github/workflows/build_deploy.yml | 13 ++++++++++-- Gemfile | 3 ++- Gemfile.lock | 33 +++++++++++++----------------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build_deploy.yml b/.github/workflows/build_deploy.yml index f57d7ad..9bc26af 100644 --- a/.github/workflows/build_deploy.yml +++ b/.github/workflows/build_deploy.yml @@ -47,12 +47,21 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Install libraries + run: | + sudo apt-get update -y + sudo apt-get install -y libxslt-dev libxml2-dev + - name: Setup Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '2.7' - bundler-cache: true - cache-version: 0 # Increment this number if you need to re-download cached gems + + - name: Run bundle + run: | + gem install nokogiri -- --use-system-libraries + bundle install + - name: Setup Pages id: pages uses: actions/configure-pages@v3 diff --git a/Gemfile b/Gemfile index ead515a..b11c632 100644 --- a/Gemfile +++ b/Gemfile @@ -36,4 +36,5 @@ gem "wdm", "~> 0.1.0" if Gem.win_platform? gem "rake" gem "html-proofer" -gem "ffi", "~> 1.16.3" \ No newline at end of file +gem "ffi", "~> 1.16.3" +gem "nokogiri", "~> 1.15.5" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index eff23ba..f448f18 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,16 +1,10 @@ GEM remote: https://rubygems.org/ specs: - activesupport (5.2.0) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) asciidoctor (1.5.7.1) colorator (1.1.0) - colorize (0.8.1) concurrent-ruby (1.0.5) em-websocket (0.5.1) eventmachine (>= 0.12.9) @@ -22,15 +16,15 @@ GEM ffi (1.16.3) forwardable-extended (2.6.0) git (1.5.0) - html-proofer (3.9.1) - activesupport (>= 4.2, < 6.0) + html-proofer (4.4.3) addressable (~> 2.3) - colorize (~> 0.8) - mercenary (~> 0.3.2) - nokogiri (~> 1.8.1) - parallel (~> 1.3) + mercenary (~> 0.3) + nokogiri (~> 1.13) + parallel (~> 1.10) + rainbow (~> 3.0) typhoeus (~> 1.3) yell (~> 2.0) + zeitwerk (~> 2.5) http_parser.rb (0.6.0) i18n (0.9.5) concurrent-ruby (~> 1.0) @@ -75,14 +69,16 @@ GEM rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) mercenary (0.3.6) - mini_portile2 (2.3.0) - minitest (5.11.3) - nokogiri (1.8.4) - mini_portile2 (~> 2.3.0) + mini_portile2 (2.8.5) + nokogiri (1.15.5) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) parallel (1.12.1) pathutil (0.16.1) forwardable-extended (~> 2.6) public_suffix (3.0.3) + racc (1.7.3) + rainbow (3.1.1) rake (12.3.1) rb-fsevent (0.10.3) rb-inotify (0.9.10) @@ -95,12 +91,10 @@ GEM sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - thread_safe (0.3.6) typhoeus (1.3.0) ethon (>= 0.9.0) - tzinfo (1.2.5) - thread_safe (~> 0.1) yell (2.0.7) + zeitwerk (2.6.12) PLATFORMS ruby @@ -115,6 +109,7 @@ DEPENDENCIES jekyll-seo-tag jekyll-theme-open-project (~> 2.0.14) jekyll-theme-open-project-helpers (~> 2.0.14) + nokogiri (~> 1.15.5) rake tzinfo-data