PIA-Servers/.gitea/workflows/fetch-new.yml

54 lines
1.3 KiB
YAML
Raw Normal View History

2024-04-27 04:00:44 +00:00
name: Fetch new Pia Servers
on:
2024-04-27 04:18:44 +00:00
schedule:
2024-04-29 00:14:41 +00:00
# - cron: "@hourly"
- cron: "*/30 * * * *"
2024-04-27 04:00:44 +00:00
push:
branches: ["master"]
paths-ignore:
- .gitignore
- README.md
- LICENSE
- servers.json
jobs:
docker:
strategy:
matrix:
arch: ["ubuntu-latest"]
git-version: ["2.44.0"]
java-version: ["17"]
maven-version: ["3.8.5"]
runs-on: ${{ matrix.arch }}
# Steps to run
steps:
# Checkout the repo
- name: Checkout
uses: actions/checkout@v4
# Setup Java and Maven
- name: Set up JDK and Maven
uses: s4u/setup-maven-action@v1.12.0
with:
java-version: ${{ matrix.java-version }}
distribution: "zulu"
maven-version: ${{ matrix.maven-version }}
2024-04-27 04:01:12 +00:00
- name: Build PIA Servers
2024-04-27 04:02:56 +00:00
run: mvn clean package -T 2C -q
2024-04-27 04:02:01 +00:00
2024-04-27 04:00:44 +00:00
- name: Fetch new PIA servers
2024-04-27 04:02:56 +00:00
run: java -jar target/PIA-Servers.jar
2024-04-27 04:00:44 +00:00
- name: Commit and push changes
run: |
2024-04-27 05:04:20 +00:00
git config --global user.email "liam+pia-servers-ci@fascinated.cc"
git config --global user.name "PIA Servers CI"
2024-04-27 04:00:44 +00:00
git add servers.json
2024-04-27 04:53:32 +00:00
git add README.md
2024-04-27 04:49:10 +00:00
git commit -m "Scheduled update"
2024-04-27 05:04:20 +00:00
git push https://pia-servers-ci:${{ secrets.AUTH_TOKEN }}@git.fascinated.cc/Fascinated/PIA-Servers
2024-04-27 04:00:44 +00:00