forked from ja2-stracciatella/ja2-stracciatella
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (33 loc) · 973 Bytes
/
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
name: Nightly trigger
on:
schedule:
- cron: '0 2 * * *'
env:
NIGHTLY: nightly
TRUNK: master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout nightly
uses: actions/checkout@v3
with:
ref: ${{ env.NIGHTLY }}
fetch-depth: 0
persist-credentials: false
- name: Update nightly
run: |
# user and email are required for pushing
git config --local user.email "madlab-bot@ja2-stracciatella.github.io"
git config --local user.name "Madlab's bot"
# fast forward to current master
git fetch origin ${TRUNK}
git merge origin/${TRUNK} --ff-only
- name: Push nightly
run: |
# push new commits to nightly
REMOTE="https://${BOT_USERNAME}:${BOT_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git push "${REMOTE}" "HEAD:${NIGHTLY}"
env:
BOT_USERNAME: madlab-bot
BOT_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}