-
Notifications
You must be signed in to change notification settings - Fork 20
44 lines (38 loc) · 1.42 KB
/
nightly_update.yaml
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
name: Update and Push MOM6 and Ocean BGC Submodule
on:
# schedule:
# - cron: '0 * * * *' # Run every hour
push:
branches: [ "feature/update-ci" ]
jobs:
nightly_update:
runs-on: ubuntu-latest
steps:
- name: Set Git user name and email
run: |
git config --global user.email ${{ secrets.GHA_EMAIL }}
git config --global user.name ${{ secrets.GHA_ID }}
- name: Check out repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
submodules: 'recursive'
- name: Update Ocean BGC Submodule
run: |
git submodule update --remote --merge src/ocean_BGC
git add src/ocean_BGC
git commit -m "Update ocean_BGC submodule nightly"
- name: Trigger CI tests for Ocean BGC Submodule
run: |
curl \
-X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/NOAA-GFDL/CEFI-regional-MOM6/actions/workflows/mom6_cobalt_1D.yaml/dispatches \
-d '{"ref":"main"}'
- name: Wait for CI tests to complete
run: |
# Use the GitHub API to check the status of the workflow runs
# Wait until all jobs in the workflow run are completed
# Check if all jobs are successful