Skip to content

Commit

Permalink
GitHub Action: update to more closely match upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
cassidyjames committed Nov 5, 2024
1 parent 56b966d commit f9f487d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down

0 comments on commit f9f487d

Please sign in to comment.