Skip to content

weekly-umami-report #109

weekly-umami-report

weekly-umami-report #109

name: weekly-umami-report
on:
schedule:
# “At 23:59 on Sunday.”
- cron: '59 23 * * 0'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
umamiReportJob:
name: weekly umami report
runs-on: ubuntu-latest
steps:
- name: Create Weekly Umami report
id: umamiReportStep
uses: boly38/action-umami-report@umami-server-2.13
with:
umami-server: https://${{secrets.UMAMI_SERVER}}
umami-user: ${{secrets.UMAMI_USERNAME}}
umami-password: ${{secrets.UMAMI_PASSWORD}}
umami-site-domain: ${{secrets.UMAMI_SITE_DOMAIN}}
umami-report-file: 'umamiReport.txt'
umami-period: '1w'
umami-unit: 'day'
umami-tz: 'Europe/Paris'
env:
UMAMI_CLIENT_TIMEOUT_MS: 5000
- name: Send Umami report to discord channel as embed when small enough
uses: tsickert/discord-webhook@v4.0.0
if: ${{ steps.umamiReportStep.outputs.pageViews > 0 && steps.umamiReportStep.outputs.umamiReportLength < 4096 }}
with:
webhook-url: ${{ secrets.UMAMI_TO_DISCORD_WEBHOOK_URL }}
content: ${{ steps.umamiReportStep.outputs.umamiOneLineReport }}
embed-title: "Umami report"
username: "umami report"
embed-description: "${{ steps.umamiReportStep.outputs.umamiReport }}"
embed-thumbnail-url: "https://umami.my-example.com"
embed-image-url: "https://raw.githubusercontent.com/umami-software/website/master/assets/logo.svg"
- name: Send Umami report to discord channel as file when big
uses: tsickert/discord-webhook@v4.0.0
if: ${{ steps.umamiReportStep.outputs.pageViews > 0 && steps.umamiReportStep.outputs.umamiReportLength >= 4096 }}
with:
webhook-url: ${{ secrets.UMAMI_TO_DISCORD_WEBHOOK_URL }}
content: ${{ steps.umamiReportStep.outputs.umamiOneLineReport }}
username: "umami report"
filename: ${{ steps.umamiReportStep.outputs.umamiReportFile }}
- name: Have a look at !secret results from next step using outputs
run: |
echo "${{ steps.umamiReportStep.outputs.umamiReportFile }}"
ls -la "${{ steps.umamiReportStep.outputs.umamiReportFile }}"