From a9c6cf21d17d197946aa3a7cb798edb625188dda Mon Sep 17 00:00:00 2001 From: ucar-tmeyer Date: Tue, 23 May 2023 16:41:12 +0000 Subject: [PATCH] Add in github action to update NDM --- .github/workflows/update_NDM.yml | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/update_NDM.yml diff --git a/.github/workflows/update_NDM.yml b/.github/workflows/update_NDM.yml new file mode 100644 index 0000000000..0d98046fa3 --- /dev/null +++ b/.github/workflows/update_NDM.yml @@ -0,0 +1,38 @@ +name: update station info + +on: + workflow_dispatch: + schedule: + - cron: "0 6 * * *" + +jobs: + update_ndm: + runs-on: ubuntu-latest + environment: + name: VLAB + steps: + # Checkout this repo + # this gets the latest code (and is run on the default branch) + - name: Checkout awips2 + uses: actions/checkout@v3 + # Do individual pulls for all the files in the ndm directory + - name: Pull latest from vlab svn repo + run: | + cd rpms/awips2.edex/Installer.edex/ndm/ + for file in *; do + svn export --force https://vlab.noaa.gov/svn/awips-ndm/trunk/"$file" --username ${{ secrets.VLAB_UNAME }} --password ${{ secrets.VLAB_PASS }} + done + # Check in all the new files + # Only do a git add/commit/push if files have changed + - name: Update existing NDM files for awips2 repo + run: | + date=`date +%Y%m%d-%H:%M:%S` + git config user.name $GITHUB_ACTOR + git config user.email $GITHUB_ACTOR@users.noreply.github.com + change=`git diff` + if [[ ! -z "$change" ]] + then + git add --all + git commit -m "New NDM updates on $date - autogenerated" + git push + fi