-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (44 loc) · 1.75 KB
/
2.1-convert-to-cupx-champs_des_alpes.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
# Copy file to planeur.net FTP server
name: 2.1 - Convert to .cupx - champs_des_alpes.cup
# Controls when the workflow will run
on:
# Triggers the workflow After the version has been added
workflow_run:
workflows: ["2 - Add version to champs_des_alpes"]
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-cupx:
if: github.ref == 'refs/heads/main' && github.repository == 'planeur-net/outlanding'
name: Convert champs_des_alpes.cup to .cupx
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v3
- name: ⚙️ Convert to .cup to .cupx and push to repo
id: convert_to_cupx
run: |
echo "Creating new .cupx file"
zip points.zip champs_des_alpes.cup
mv ./Pics ./Pics_guide_aires_securite
mv ./Pics_champs_des_alpes ./Pics
zip -r pics.zip Pics
cat pics.zip points.zip > champs_des_alpes.cupx
# push to repo
echo "Pulling latest version before push..."
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 .cub to repo
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: ${{ steps.convert_to_cupx.outputs.LAST_COMMIT_MESSSAGE }}
file_pattern: 'champs_des_alpes.cupx'
- name: Trigger event for github pages update
uses: peter-evans/repository-dispatch@v2
with:
event-type: update-pages-event