Skip to content

Commit

Permalink
R2 library uploader
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Nov 20, 2024
1 parent fa975ba commit 9d892d3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/json_library_upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: JSON Library Upload

on:
workflow_dispatch:

jobs:
librarian:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Upload library
uses: ryand56/r2-upload-action@latest
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: ./custom_components/battery_notes/data/
keep-file-fresh: true

- name: Purge cache for latest schema
uses: jakejarvis/cloudflare-purge-action@master
env:
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
PURGE_URLS: '["https://battery-notes-data.codechimp.org/library.json"]'

0 comments on commit 9d892d3

Please sign in to comment.