umami-report-daily #253
This file contains hidden or 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
| name: umami-report-daily | |
| on: | |
| schedule: | |
| - cron: '35 18 * * *' | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| umamiReportJob: | |
| name: umami report daily | |
| runs-on: ubuntu-latest | |
| env: | |
| UMAMI_LOGO: https://raw.githubusercontent.com/umami-software/website/refs/heads/master/public/images/umami-logo.png | |
| steps: | |
| - name: Create Daily Umami report | |
| id: umamiReportStep | |
| uses: boly38/[email protected] | |
| with: | |
| umami-cloud-api-key: ${{secrets.UMAMI_APIKEY}} | |
| umami-site-domain: ${{secrets.UMAMI_SITE_DOMAIN}} | |
| umami-report-file: 'umamiReport.txt' | |
| - name: Assume umamiReportFile exists and pageViews != 0 | |
| run: | | |
| if [[ -z "${{ steps.umamiReportStep.outputs.umamiReportFile }}" ]]; then | |
| echo "::error title=no umamiReportFile::❌ Error : no umamiReportFile" | |
| exit 1 | |
| fi | |
| if [[ "${{ steps.umamiReportStep.outputs.pageViews }}" == "0" ]]; then | |
| echo "::notice title=no pageViews::ℹ️ pageViews=0 😞" | |
| exit 0 | |
| fi | |
| echo "::notice title=OneLineReport::ℹ️ ${{ steps.umamiReportStep.outputs.umamiOneLineReport }}" | |
| - name: Send inline Umami Cloud report to discord if pageViews is positive and length lt 2000 | |
| if: steps.umamiReportStep.outputs.pageViews != '0' && steps.umamiReportStep.outputs.umamiReportLength < 2000 | |
| uses: tsickert/[email protected] | |
| with: | |
| webhook-url: ${{ secrets.UMAMI_TO_DISCORD_WEBHOOK_URL }} | |
| username: "Umami report" | |
| avatar-url: ${{ env.UMAMI_LOGO }} | |
| content: "${{ steps.umamiReportStep.outputs.umamiReport }}" | |
| - name: Send Umami Cloud report to discord if pageViews is positive | |
| if: steps.umamiReportStep.outputs.pageViews != '0' && steps.umamiReportStep.outputs.umamiReportLength >= 2000 | |
| uses: tsickert/[email protected] | |
| with: | |
| webhook-url: ${{ secrets.UMAMI_TO_DISCORD_WEBHOOK_URL }} | |
| username: "Umami report" | |
| avatar-url: ${{ env.UMAMI_LOGO }} | |
| content: "${{ steps.umamiReportStep.outputs.umamiOneLineReport }}" | |
| filename: "${{ steps.umamiReportStep.outputs.umamiReportFile }}" |