Repository navigation
48 lines (44 loc) · 1.81 KB
/
Copy pathnightly.yml
File metadata and controls
48 lines (44 loc) · 1.81 KB
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
# generated by praktika
# Thin GH-Actions ignition: no real work runs here. It signs a trigger and POSTs
# it to the Praktika gh-trigger lambda, which enqueues the native workflow run.
name: Nightly
on:
schedule:
- cron: 0 2 * * *
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
env:
PYTHONUNBUFFERED: 1
jobs:
ignite:
runs-on: [ubuntu-latest]
steps:
- name: Enqueue praktika trigger
env:
GH_WEBHOOK_SECRET: ${{ secrets.GH_WEBHOOK_SECRET }}
PRAKTIKA_TRIGGER_URL: ${{ vars.PRAKTIKA_TRIGGER_URL }}
INPUTS_JSON: ${{ toJson(github.event.inputs) }}
run: |
set -euo pipefail
BODY=$(jq -cn \
--arg type "schedule" \
--arg wf "Nightly" \
--arg repo "${{ github.repository }}" \
--arg ref "${{ github.ref_name }}" \
--arg sha "${{ github.sha }}" \
--argjson inputs "${INPUTS_JSON:-null}" \
'{type:$type,workflow_name:$wf,repo:$repo,head_ref:$ref,head_sha:$sha,inputs:$inputs}')
SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$GH_WEBHOOK_SECRET" -r | cut -d' ' -f1)
curl -sSf -X POST "$PRAKTIKA_TRIGGER_URL" \
-H 'Content-Type: application/json' \
-H 'X-GitHub-Event: praktika_ignition' \
-H "X-GitHub-Delivery: ignite-${{ github.run_id }}-${{ github.run_attempt }}" \
-H "X-Hub-Signature-256: sha256=$SIG" \
--data "$BODY"
- name: Report link
run: |
URL='https://silk-artifacts-eu-north-1.s3.amazonaws.com/praktika.html?REF=${{ github.ref_name }}&sha=${{ github.sha }}&name_0=Nightly'
echo "::notice title=Praktika report::$URL"
echo "[Praktika report]($URL)" >> "$GITHUB_STEP_SUMMARY"