Skip to content

Schedule

Schedule #754

Workflow file for this run

name: Schedule
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *"
jobs:
backup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 14
- name: Backup
uses: docker://mcr.microsoft.com/azure-cli
with:
args: "bash ./scripts/dump_matomo_yesterday.sh"
env:
AZ_STORAGE_TOKEN: ${{ secrets.AZ_STORAGE_TOKEN }}
- name: Download
uses: docker://mcr.microsoft.com/azure-cli
with:
args: "bash ./scripts/download_dump.sh"
env:
AZ_STORAGE_TOKEN: ${{ secrets.AZ_STORAGE_TOKEN }}
- name: Ingest
run: |
yarn
yarn monolog ingest
env:
CDTN_API_URL: https://code-du-travail-numerique-dev.dev.fabrique.social.gouv.fr
ELASTICSEARCH_URL: ${{ secrets.ELASTICSEARCH_URL }}
API_KEY: ${{ secrets.API_KEY }}
- name: Create the Mattermost Message
if: failure()
run: |
echo "{\"text\":\"La synchro des données Matomo a échoué, veuillez relancer le job : ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}\"}" > mattermost.json
- uses: mattermost/action-mattermost-notify@master
if: failure()
with:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}