-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (44 loc) · 1.3 KB
/
evergreen.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
name: evergreen
on:
schedule:
- cron: '30 09 * * *'
workflow_dispatch:
concurrency: evergreen
permissions:
contents: write
jobs:
evergreen:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
with:
persist-credentials: 'true'
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Update nix flake
run: nix flake update
- name: Push changes
id: push
run: |
if [[ `git status flake.lock --porcelain` ]]; then
git config user.name github-actions
git config user.email [email protected]
git add flake.lock
git commit -m "bot: nix flake update"
git push
echo "trigger_build=1" >> $GITHUB_OUTPUT
else
echo "flake.lock is not changed..."
echo "trigger_build=0" >> $GITHUB_OUTPUT
fi
- name: Trigger build
uses: actions/github-script@v7
if: steps.push.outputs.trigger_build == '1'
with:
script: |
github.rest.repos.createDispatchEvent({
owner: context.repo.owner,
repo: context.repo.repo,
event_type: 'build',
});