-
Notifications
You must be signed in to change notification settings - Fork 7
54 lines (50 loc) · 1.49 KB
/
build_main.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
46
47
48
49
50
51
52
53
54
name: Build YARD with main
on:
workflow_dispatch:
schedule:
- cron: "0 * * * *"
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.2
bundler-cache: true
- name: Set up git settings
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
- name: Clone pages
env:
SSH_SECRET: ${{ secrets.SSH }}
GIT_SSH_COMMAND: ssh -i ~/ssh_secret
run: |
echo "$SSH_SECRET" > ~/ssh_secret
chmod 600 ~/ssh_secret
git clone [email protected]:discorb-lib/discorb-lib.github.io /tmp/pages
- name: Install dependencies
run: |
bundle config --local with 'docs'
bundle install
gem update uri
- name: Generate document
run: bundle exec rake document
- name: Push document
env:
SSH_SECRET: ${{ secrets.SSH }}
GIT_SSH_COMMAND: ssh -i ~/ssh_secret
run: |
echo "$SSH_SECRET" > ~/ssh_secret
chmod 600 ~/ssh_secret
cp -r ./doc/. /tmp/pages
cd /tmp/pages
git add -A
git commit -m "Update: Update document for ${{ github.sha }} by cron"
git update-ref -d refs/remotes/origin/user
git push origin main -f
continue-on-error: true