-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (34 loc) · 1.32 KB
/
leaflet_updater.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
name: Download Latest Leaflet
on:
workflow_dispatch: # Ermöglicht manuelle Auslösung des Workflows
jobs:
download_leaflet:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Get Latest Leaflet Version
id: get_version
run: |
LATEST_VERSION=$(curl -s https://api.github.com/repos/Leaflet/Leaflet/releases/latest | jq -r .tag_name)
echo "::set-output name=version::$LATEST_VERSION"
- name: Download Leaflet
run: |
LATEST_VERSION="${{ steps.get_version.outputs.version }}"
echo "Downloading Leaflet version $LATEST_VERSION..."
curl -L "https://github.com/Leaflet/Leaflet/releases/latest/download/leaflet.zip" -o leaflet.zip
unzip leaflet.zip
- name: Remove Old Leaflet Directory
run: |
if [ -d "assets/leaflet" ]; then
echo "Deleting old leaflet directory..."
rm -rf assets/leaflet
fi
- name: Move Leaflet Files
run: |
mv dist assets/leaflet
- name: Commit and Push Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update Leaflet to ${{ steps.get_version.outputs.version }}"
branch: ${{ github.ref }} # Commit auf dem aktuellen Branch