diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 587a795..59371ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,11 @@ on: schedule: - cron: "0 9 15 * *" # every 15th of the month at 9:00 AM UTC workflow_dispatch: + inputs: + with_analytics: + description: "Render awesome data with analytics" + required: false + default: "true" jobs: render-data: @@ -37,12 +42,12 @@ jobs: make setup-ci - name: Render awesome data - if: github.event_name == 'push' + if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.with_analytics == 'false') run: | make release ARGS=--without-analytics - name: Render awesome with analytics data - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.with_analytics == 'true') env: TOKEN_GITHUB_PUBLIC_API: ${{ secrets.TOKEN_GITHUB_PUBLIC_API }} run: | @@ -68,12 +73,17 @@ jobs: retries: 3 script: | const owner = 'italia-opensource'; - const repo = 'italia-opensource-website'; - const event_type = 'deployment'; + const repo = 'italiaopensource.com'; + const event_type = 'sync-database'; const ref = 'main'; + const client_payload = { + "hash": "${{ github.sha }}", + "run_id": "${{ github.run_id }}", + }; github.rest.repos.createDispatchEvent({ owner, repo, - event_type + event_type, + client_payload });