-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (58 loc) · 2.7 KB
/
daily_umami_report.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: daily-umami-report
on:
schedule:
- cron: '30 17 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
umamiReportJob:
name: daily umami report
runs-on: ubuntu-latest
outputs:
umami_page_views: ${{ steps.umamiReportStep.outputs.pageViews }}
umami_report_file: ${{ steps.umamiReportStep.outputs.umamiReportFile }}
# umami_report: ${{ steps.umamiReport.outputs.umamiReport }}
# umami_one_line_report: ${{ steps.umamiReport.outputs.umamiOneLineReport }}
steps:
- name: Create Daily Umami report
id: umamiReportStep
uses: boly38/[email protected]
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'
env:
UMAMI_CLIENT_TIMEOUT_MS: 5000
- name: Send Umami report to discord channel as embed when small enough
uses: tsickert/[email protected]
if: ${{ 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/[email protected]
if: ${{ 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 }}"
nextJob:
needs: umamiReportJob
name: github action next job
runs-on: ubuntu-latest
steps:
- name: print var
run: |
echo "FROM umamiReport outputs: ${{ needs.umamiReportJob.outputs.umami_report_file }} and ${{ needs.umamiReportJob.outputs.umami_page_views }} pageviews "