Skip to content

Fetch

Fetch #350

Workflow file for this run

name: Fetch
on:
schedule:
- cron: "0 4 * * *"
push:
branches: [master]
pull_request:
branches: [master]
# 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: "pages"
cancel-in-progress: false
jobs:
build:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@master
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node-version }}
- run: |
npm install
git config --global user.name paulcarroty && git config --global user.email $GMAIL
curl -L https://github.com/paulcarroty/flathub-chart/releases/download/latest/daily.json -o src/assets/daily.json
curl -L https://github.com/paulcarroty/flathub-chart/releases/download/latest/weekly.json -o src/assets/weekly.json
curl -L https://github.com/paulcarroty/flathub-chart/releases/download/latest/monthly.json -o src/assets/monthly.json
curl -L https://github.com/paulcarroty/flathub-chart/releases/download/latest/yearly.json -o src/assets/yearly.json
curl -L https://github.com/paulcarroty/flathub-chart/releases/download/latest/timestamp.json -o src/assets/timestamp.json
sudo apt update && sudo apt install hub
hub release create -m "Daily sync `date -u`" latest || echo "can't create the release 'latest', probably it's available"
node fetch.js && for chart in *ly.json timestamp.json; do
hub release edit latest -a "$chart" -m "Daily sync `date -u`"
mv $chart src/assets/
done
npm run build
env:
GITHUB_TOKEN: ${{ secrets.GT }}
GMAIL: ${{ secrets.GMAIL }}
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2