-
Notifications
You must be signed in to change notification settings - Fork 133
50 lines (48 loc) · 1.51 KB
/
deploy.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
name: Deploy
on: [ workflow_dispatch ]
jobs:
deploy:
runs-on: ubuntu-latest
env:
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
- name: Install dependencies
run: |
git submodule update --init
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Generate guides files
run: bundle exec rake guides:generate:html
- name: Git setup
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git stash --include-untracked
git checkout --track origin/site
- name: Commit site changes
run: |
rm site/javascripts/lunr-documents.js
rm site/javascripts/lunr-index.js
git stash apply
cp $(find output/pt-BR -name "*.html") site
git add site/
git commit -m "Build from commit ${GITHUB_SHA}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
branch: 'site'