Skip to content

Node.js CI

Node.js CI #16

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI
on:
push:
paths:
- "**.dat"
workflow_dispatch:
jobs:
generate_listeramq:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- run: npm ci
- name: Set current date
run: |
echo "Obtention de la date du jour pour le commit"
echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Obtenir le nom du fichier .dat
id: get_dat_file
run: |
echo "DAT_FILE_NAME=ESR2_FICHVALID.dat"
echo "DAT_FILE_NAME=ESR2_FICHVALID.dat" >> $GITHUB_ENV
- name: Rename output/listeRamq.json to output/listeRamq_old.json
run: mv output/listeRamq.json output/listeRamq_old.json
- name: Run the index.js script to generate the listeRamq.json
run: node index.js -i ${{ env.DAT_FILE_NAME }} -o output/listeRamq.json
- name: Commit the changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Workflow update liste Ramq ${{ env.CURRENT_DATE}}"
git push