-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.52 KB
/
documentation.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: Documentation CI
on:
push:
branches: [ "main" ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
documentation:
name: Update documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
- name: Set up Elixir
uses: erlef/setup-beam@b9c58b0450cd832ccdb3c17cc156a47065d2114f # v1.18.1
with:
elixir-version: '1.15.2' # [Required] Define the Elixir version
otp-version: '26.0' # [Required] Define the Erlang/OTP version
- name: Restore dependencies cache
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Generate Documentation
run: mix docs
- name: Include docs folder
run: |
sed -i '/\/docs\//d' .gitignore
- name: Commit changes to documentation branch
env:
ATTR_NAME: 'github-actions[bot]'
ATTR_EMAIL: 'github-actions[bot]@users.noreply.github.com'
run: |
git config --global user.name $ATTR_NAME
git config --global user.email $ATTR_EMAIL
git add docs/*
git commit -am "Automatic docs generation"
git fetch origin docs
git push origin main:docs --force-with-lease