-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (61 loc) · 1.88 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
name: CollectionSpace nightly build
on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
permissions:
pull-requests: write
contents: write
jobs:
nightly:
name: CollectionSpace nightly build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build, run and test CollectionSpace
run: ./build_and_run_tests.sh
- name: Ping Slack if the build failed
if: ${{ failure() }}
id: slack
uses: slackapi/[email protected]
with:
payload: |
{
"text": "CollectionSpace nightly build result",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Failed: ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
timestamp:
name: Refresh project timestamp
runs-on: ubuntu-latest
needs:
- nightly
if: needs.nightly.result == 'success'
steps:
- uses: actions/checkout@v3
- name: Update timestamp
run: ./timestamp.sh
# https://github.com/peter-evans/create-pull-request
- name: Create the timestamp PR
id: cpr
uses: peter-evans/create-pull-request@v4
with:
author: GitHub <[email protected]>
# https://github.com/juliangruber/merge-pull-request-action
- name: Merge the timestamp PR
uses: juliangruber/merge-pull-request-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.cpr.outputs.pull-request-number }}
method: squash # merge rebase