CollectionSpace nightly build #1082
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |