Skip to content

3.2 - Create cols_des_alpes.kmz #16

3.2 - Create cols_des_alpes.kmz

3.2 - Create cols_des_alpes.kmz #16

name: 3.2 - Create cols_des_alpes.kmz
# Controls when the workflow will run
on:
# Triggers the workflow After the version has been added
workflow_run:
workflows: ["3.1 - Convert to .cupx - cols_des_alpes.cup"]
types:
- completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
# see: https://github.com/marketplace/actions/ftp-deployment
jobs:
convert-to-kmz:
if: github.ref == 'refs/heads/main' && github.repository == 'planeur-net/outlanding'
name: Checkout repo for cup
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code for outlanding
uses: actions/checkout@v3
with:
path: ./outlanding
- name: 🚚 Get latest code for cup2kmz
uses: actions/checkout@v3
with:
repository: llauner/cup2kmz
token: ${{ secrets.ACCESS_TOKEN_CUP2KMZ }}
path: ./cup2kmz
ref: master
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install dependencies
run: |
cd ./cup2kmz
npm install
- name: ⚙️ Convert to .kml + .kmz
id: convert_to_kmz
run: |
cd ./cup2kmz
node ./cuptokmz.js ../outlanding/cols_des_alpes.cup
# push to repo
echo "Pulling latest version before push..."
cd ../outlanding
git pull
# Save commit message for future push
echo "LAST_COMMIT_MESSSAGE=`git log --format=%s -n 1 -- cols_des_alpes.cup`" >> $GITHUB_OUTPUT
- name: ⚙️ Push .kml + .kmz to repo
uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: ./outlanding
commit_message: ${{ steps.convert_to_kmz.outputs.LAST_COMMIT_MESSSAGE }}
file_pattern: 'cols_des_alpes.*'
- name: Trigger event for github pages update
uses: peter-evans/repository-dispatch@v2
with:
event-type: update-pages-event