-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (50 loc) · 1.7 KB
/
update-server-repository.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Update LMS Server Repository
on:
schedule:
- cron: "26 */8 * * *"
workflow_dispatch:
jobs:
merge:
name: Update server repository
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: npm install "@aws-sdk/client-s3" jstoxml@3 dotenv@16 fast-xml-parser@4
- name: Update S3 bucket
env:
ACCESS_KEY_ID: '${{ secrets.ACCESS_KEY_ID }}'
SECRET_ACCESS_KEY: '${{ secrets.SECRET_ACCESS_KEY }}'
R2_ACCESS_KEY_ID: '${{ secrets.R2_ACCESS_KEY_ID }}'
R2_SECRET_ACCESS_KEY: '${{ secrets.R2_SECRET_ACCESS_KEY }}'
R2_ENDPOINT_URL: '${{ secrets.R2_ENDPOINT_URL }}'
run: node tools/updateRepository.mjs
- name: Commit Changes (if needed)
if: ${{ env.DEBUG == '' }}
run: |
if [ -z "$(git status --porcelain)" ]; then
echo No changes to commit
else
git config user.name "LMS Server Repository Updater"
git config user.email "[email protected]"
git add latest.xml stable.xml dev.xml servers.json
git commit -a -m "Update Server Repository ${{ github.event.inputs.version }}"
git push
fi
- name: Log Changes
if: ${{ env.DEBUG }}
run: |
git --no-pager diff
git status
bumpWebSite:
name: Bump lyrion.org to pick up latest server builds
runs-on: ubuntu-24.04
needs: merge
permissions:
actions: write
steps:
- name: Update web site
env:
GH_TOKEN: ${{ secrets.DEPLOYMENT_KEY }}
run: gh workflow run main.yml -R LMS-Community/lms-community.github.io