2023-05-18 11:25:12 +00:00
|
|
|
name: Sync lnproxy relays
|
2023-05-18 11:14:11 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
# * is a special character in YAML so you have to quote this string
|
2023-05-22 09:41:40 +00:00
|
|
|
- cron: "0 12 * * 0" # Run every Sunday at noon
|
2023-05-18 11:14:11 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
sync:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2023-05-22 09:41:40 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2023-05-23 13:18:17 +00:00
|
|
|
pull-requests: write
|
2023-05-22 09:41:40 +00:00
|
|
|
|
2023-05-18 11:14:11 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-11 16:00:32 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-05-18 11:14:11 +00:00
|
|
|
|
2023-05-23 13:18:17 +00:00
|
|
|
- name: Fetch and process lnproxy relay JSON file
|
2023-05-18 11:14:11 +00:00
|
|
|
run: |
|
2023-05-22 09:41:40 +00:00
|
|
|
curl https://raw.githubusercontent.com/lnproxy/lnproxy-webui2/main/assets/relays.json -o lnproxy_tmplist.json
|
2023-05-29 18:22:41 +00:00
|
|
|
node ./scripts/lnproxy-sync.js
|
2023-05-18 11:14:11 +00:00
|
|
|
git add ./frontend/static/lnproxies.json
|
|
|
|
|
|
|
|
- name: Remove tmp lnproxy json file
|
2023-05-22 09:41:40 +00:00
|
|
|
run: rm lnproxy_tmplist.json
|
2023-05-23 13:18:17 +00:00
|
|
|
|
|
|
|
- name: Get the date for use in subsequent steps
|
|
|
|
id: getdate
|
|
|
|
run: echo "current_date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Submit pull request
|
2024-02-07 12:26:54 +00:00
|
|
|
uses: peter-evans/create-pull-request@v6
|
2023-05-23 13:18:17 +00:00
|
|
|
with:
|
|
|
|
commit-message: "Update LNProxy relay list on ${{ env.current_date }}"
|
|
|
|
committer: GitHub Action <action@github.com>
|
|
|
|
branch: "lnproxy-${{ env.current_date }}"
|
|
|
|
delete-branch: true
|
|
|
|
title: "[GitHub Action] Update LNProxy relay list ${{ env.current_date }}"
|