1.2 - Create .kmz #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy file to planeur.net FTP server | |
name: 1.2 - Create .kmz | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow After the version has been added | |
workflow_run: | |
workflows: ["1.1 - Convert to .cupx"] | |
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/guide_aires_securite.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 -- champs_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: 'guide_aires_securite.kml guide_aires_securite.kmz' | |