2-create_openair_standard #30
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
# 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 |