-
Notifications
You must be signed in to change notification settings - Fork 9
112 lines (96 loc) · 3.53 KB
/
2-create-openair-standard.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Create OpenAir Standard
name: 2-create_openair_standard
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
workflow_run:
workflows: ["1-Validate_Add_Version_Convert_Push_to_FTP"]
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-openair-standard:
name: Convert to OpenAir standard
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
with:
path: ./airspace
- name: 🚚 Get OpenAirExtended2OpenAir
uses: actions/checkout@v4
with:
repository: llauner/OpenAirExtended2OpenAir
token: ${{ secrets.ACCESS_TOKEN }}
path: ./OpenAirExtended2OpenAir
ref: master
- name: Convert to OpenAir standard
id: convert
run: |
echo "## Install OpenAirExtended2OpenAir"
cd OpenAirExtended2OpenAir
npm install
echo "## Converting ..."
rm ../airspace/france_openair_standard.txt
node ./main.js ../airspace/france.txt ../airspace/france_openair_standard.txt
- name: Validate france_openair_standard.txt
id: validation
run: |
echo "## Install openaip-openair-parser"
cd ./airspace
npm install
echo "## Validating ..."
node src/validate-openair.js
SCRIPT_OUTPUT=$(node src/validate-openair.js)
SCRIPT_RC=$?
echo "parser_output=$SCRIPT_OUTPUT"
echo "parser_output=$SCRIPT_OUTPUT" >> $GITHUB_OUTPUT
- name: Display validation output
run: |
echo "Validation output="
echo ${{steps.validation.outputs.parser_output}}
- name: Check validation
if: contains(steps.validation.outputs.parser_output, 'Error')
uses: actions/github-script@v3
with:
script: |
always() &&
core.setFailed('Validation failed ! See Above step for details...')
- name: Get commit Message
id: get_commit_message
run: |
# Save commit message for future push
cd ./airspace
echo "LAST_COMMIT_MESSSAGE=`git log --format=%s -n 1 -- france.txt`" >> $GITHUB_OUTPUT
- name: ⚙️ Push france_openair_standard.txt to repo
id: push_changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: ./airspace
commit_message: ${{ steps.get_commit_message.outputs.LAST_COMMIT_MESSSAGE }}
file_pattern: 'france_openair_standard.txt'
publish-pages:
name: Pyublish pages to github pages
runs-on: ubuntu-latest
needs: [convert-openair-standard]
steps:
- name: Trigger event for github pages update
uses: peter-evans/repository-dispatch@v2
with:
event-type: update-pages-event
push-event-to-other-repo:
needs: [convert-openair-standard]
name: Dispatch to other repo= planeur-net/outlanding
runs-on: ubuntu-latest
steps:
- name: Emit repository_dispatch
uses: mvasigh/dispatch-action@main
with:
# You should create a personal access token and store it in your repository
token: ${{ secrets.ACCESS_TOKEN }}
repo: outlanding
owner: planeur-net
event_type: airspace-update