forked from omegaup/omegaup
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1.38 KB
/
daily-release.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
name: daily-release
# Run every day at 3:00 UTC. This translates to 20:00 PT.
# TODO(#1624): Make this daily once we have better coverage of the frontend.
on:
repository_dispatch:
types: daily-release
schedule:
- cron: '0 3 * * 0'
jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Fetch all refs
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- name: Check for database modifications
run: |
if ! git diff --quiet origin/release:frontend/database origin/main:frontend/database; then
echo '::warning::Skipping release since there are database modifications'
exit 1
fi
- name: Check for presence of .pause-release
run: |
if git cat-file -e origin/main:.pause-release 2>/dev/null; then
echo '::warning::Skipping release since there is a `.pause-release` file.'
exit 1
fi
- name: Merge main into release
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/merges \
--header "Authorization: Bearer ${{ secrets.OMEGAUPBOT_RELEASE_TOKEN }}" \
--data "{\"base\":\"release\",\"head\":\"main\",\"commit_message\":\"Merge branch 'main' of github.com:omegaup/omegaup into release\"}"