diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index ee717dca..be2feea6 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -15,34 +15,25 @@ jobs: build: runs-on: ubuntu-latest steps: + - name: Install dependencies + run: | + sudo apt update && sudo apt install ruby-nokogiri git - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 # Not needed with a .ruby-version file - bundler-cache: true + uses: actions/checkout@v3 - name: Build run: | - sudo apt update && sudo apt install ruby-nokogiri - gem install nokogiri -- --use-system-libraries + rm apps/* ruby ./generate-eos-apps.rb - name: Commit run: | FILES_CHANGED=$(git diff --name-only | wc -l) if [[ $FILES_CHANGED != 0 ]]; then - git config --local user.email "actions@github.com" + git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add -A git commit -m "Automatic update of data" -a + git push fi - - - name: Push - uses: ad-m/github-push-action@v0.6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: main diff --git a/README.md b/README.md index f5934301..e5d6b101 100644 --- a/README.md +++ b/README.md @@ -4,19 +4,39 @@ Web frontend for viewing first-party educational content apps for Endless OS. ## Data -Ideally we could download the data on demand when building, but for now I'm copying `/var/lib/flatpak/appstream/eos-apps/x86_64/active/appstream.xml` and `/var/lib/flatpak/appstream/eos-apps/x86_64/active/icons/` from an Endless OS install to the root of this repo. +Ideally we could download the data on demand when building, but for now I'm copying `/var/lib/flatpak/appstream/eos-apps/x86_64/active/appstream.xml` and `/var/lib/flatpak/appstream/eos-apps/x86_64/active/icons/` from an Endless OS install to the root of this repo and to `images/` respectively. ## Building This site is a simple Jekyll-powered site hosted by GitHub Pages. To run it locally, see [the GitHub docs](https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/). -I recommend using `toolbox` to develop, especially if you're on Endless OS or Fedora Silverblue; see [this blog post](https://cassidyjames.com/blog/github-pages-jekyll-fedora-silverblue/) for details. +I recommend using `toolbox` to develop, especially if you're on Endless OS or Fedora Silverblue; see [this blog post](https://cassidyjames.com/blog/github-pages-jekyll-fedora-silverblue/) for more details. But in brief, this should get you going: + +```shell +toolbox enter +sudo dnf install ruby ruby-devel openssl-devel @development-tools gcc-c++ +sudo gem install bundler +bundle install +``` + +You may need to manually install some gems, e.g.: + +```shell +sudo dnf install rubygem-nokogiri rubygem-crack +``` + +Then to run: + +```shell +bundle exec jekyll serve --host 0.0.0.0 +``` ### Updating Apps -The list of apps is generated with a simple Ruby script. To rebuild the app list (e.g. if you've changed something in the Ruby script), run: +The list of apps is generated with a simple Ruby script. To rebuild the app list, delete the existing files so any removals (e.g. end-of-life apps) are reflected, then run the script: ```shell +rm _apps/* ruby generate-eos-apps.rb ```