Skip to content

daily-release

daily-release #108

Workflow file for this run

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\"}"