Skip to content

.github/workflows/nightly.yml #197

.github/workflows/nightly.yml

.github/workflows/nightly.yml #197

Workflow file for this run

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 }}