-
Notifications
You must be signed in to change notification settings - Fork 34
45 lines (35 loc) · 1.32 KB
/
update.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
42
43
44
45
name: Update sources
# Run on push and 4 times per day
on:
schedule:
- cron: 0 0,6,12,18 * * *
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
container: universalteam/db
steps:
- uses: actions/checkout@v1
- name: Delete old pages and QRs
run: rm -rf docs/_3ds/* docs/_ds/* docs/assets/images/qr/*.png docs/assets/images/qr/nightly/*.png docs/assets/images/qr/prerelease/*.png
- name: Run generate.py
run: |
export PATH=$PATH:/opt/devkitpro/tools/bin
python3 source/generate.py source/apps docs --token ${{ secrets.GITHUB_TOKEN }}
- name: Pull origin
run: git pull origin master --ff-only # Pull origin in case a commit has been done while updating
- name: Push changes
run: |
git config user.email "[email protected]"
git config user.name "TWLBot"
echo "machine github.com" > "$HOME/.netrc"
echo " login TWLBot" >> "$HOME/.netrc"
echo " password ${{ secrets.GITHUB_TOKEN }}" >> "$HOME/.netrc"
echo "machine api.github.com" >> "$HOME/.netrc"
echo " login TWLBot" >> "$HOME/.netrc"
echo " password ${{ secrets.GITHUB_TOKEN }}" >> "$HOME/.netrc"
git checkout master
git stage .
if git commit -m "Update sources"; then
git push origin master
fi