-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.42 KB
/
nightly.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
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
nightly:
runs-on: [self-hosted, linux, nix]
steps:
- name: checkout
uses: actions/checkout@v4
- name: update
run: ./update.sh
- name: commit
run: |
[[ $(git diff) != "" ]] || exit 0
git config --local user.name "Prosecco"
git config --local user.email "[email protected]"
git commit -am "nightly update"
- name: push
uses: ad-m/github-push-action@master
with:
branch: main
- name: generate zulip message
run: |
{
echo 'MSG<<EOF'
echo "*Nightly update*"
nix shell nixpkgs#jq --command ./message.sh
echo EOF
} >> "$GITHUB_ENV"
env:
RUN: ${{ github.run_id }}
- name: send zulip info message
uses: slackapi/[email protected]
with:
payload: |
{ "text": ${{ toJSON(env.MSG) }} }
env:
SLACK_WEBHOOK_URL: ${{ secrets.ZULIP_WEBHOOK_URL }}
- name: send zulip error message
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
payload: |
{ "text": "Unexpected Error: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" }
env:
SLACK_WEBHOOK_URL: ${{ secrets.ZULIP_WEBHOOK_URL }}