⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Build

Build #306

Workflow file for this run

name: Build
on:
schedule:
- cron: '0 0-9 * * 1-5'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Update metadata.json
run: |
URL=$(curl -G 'https://api.thecatapi.com/v1/images/search?size=med&mime_types=jpg&order=RANDOM' | jq -r '.[0].url')
echo "{\"imageUrl\":\"$URL\",\"timestamp\":$(date +%s)}" > public/metadata.json
- name: Build
run: npm run build
- name: Configure Git
run: |
git config --global user.name 'gh-actions'
git config --global user.email '[email protected]'
- name: Commit and push if changed
run: |
git add -A
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "build"
git push
fi