Skip to content

Update Version Files #3

Update Version Files

Update Version Files #3

Workflow file for this run

name: Update JSON Files
on:
schedule:
- cron: '0 */6 * * *' # Run every 6 hours
workflow_dispatch: # Allow manual trigger
jobs:
update-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download JSON files
run: |
curl -o stable.json https://version.home-assistant.io/stable.json
curl -o beta.json https://version.home-assistant.io/beta.json
- name: Update URLs in JSON files
run: |
sed -i 's|https://os-artifacts.home-assistant.io/|https://github.com/ameriDroid/HA-operating-system/releases/download/|g' stable.json
sed -i 's|https://os-artifacts.home-assistant.io/|https://github.com/ameriDroid/HA-operating-system/releases/download/|g' beta.json
- name: Copy index.html
run: cp index.html /tmp/index.html
- name: Setup git config
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
- name: Switch to gh-pages
run: |
git checkout gh-pages
cp /tmp/index.html index.html
cp stable.json stable.json
cp beta.json beta.json
git add index.html stable.json beta.json
git commit -m "Update JSON files"
git push origin gh-pages --force