Skip to content

update applist

update applist #1673

name: Update and Build
# Controls when the workflow will run
on:
push:
branches:
- master
# run at 2:00 UTC every day
schedule:
- cron: '0 2 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to send a dispatch event from another repository to run this actions
repository_dispatch:
types: [update applist]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# JOB to run change detection
changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
applist: ${{ steps.filter.outputs.applist }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
applist:
- '.github/workflows/update_applist.yml'
- '.github/workflows/update-wiki.sh'
- 'src/img/category-selections/*.svg'
- 'src/img/*.svg'
update-applist:
needs: changes
if: ${{ needs.changes.outputs.applist == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
# Runs a set of commands using the runners shell
- name: Generate pi-apps applist and install webpages
run: |
sudo apt update
sudo apt install gnuplot jq moreutils -y
sudo npm install -g svgexport --unsafe-perm=true
$GITHUB_WORKSPACE/.github/workflows/update-wiki.sh
- name: Push changes to repo
uses: EndBug/add-and-commit@v9 # You can change this to use a specific version.
with:
default_author: github_actions
message: |
Update applist, run by GitHub Actions
build:
needs: update-applist
if: always()
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v3
with:
# build off of master branch commit regardless of what commit this CI was triggered by
# necessary since the update-applist job pushes to master during this workflow if it is run
ref: master
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies & build
run: |
npm ci
npm run build
cp CNAME _site/CNAME
cp google6dec36f39e57b8f9.html _site/google6dec36f39e57b8f9.html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./_site
github_token: ${{ secrets.GITHUB_TOKEN }}
user_name: 'github-actions[bot]'
user_email: '41898282+github-actions[bot]@users.noreply.github.com'