aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/docs.yml78
1 files changed, 47 insertions, 31 deletions
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index ca59856..84048cf 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -4,6 +4,13 @@ on:
push:
branches:
- master
+ pull_request:
+ branches:
+ - master
+ paths:
+ - .github/workflows/docs.yml
+ - include/**
+ - src/**
permissions:
contents: read
@@ -20,41 +27,49 @@ jobs:
runs-on: ubuntu-latest
steps:
- - name: Checkout code
- uses: actions/checkout@v4
+ - name: Checkout code
+ uses: actions/checkout@v4
- - name: Setup Erlang/OTP
- uses: erlef/setup-beam@v1
- with:
- otp-version: '27'
- rebar3-version: '3.23'
+ - name: Setup Erlang/OTP
+ uses: erlef/setup-beam@v1
+ with:
+ otp-version: "27"
+ rebar3-version: "3.23"
- - name: Restore dependencies cache
- uses: actions/cache@v4
- with:
- path: |
- _build
- rebar.lock
- key: ${{ runner.os }}-rebar3-${{ hashFiles('rebar.config') }}
- restore-keys: |
- ${{ runner.os }}-rebar3-
+ - name: Restore dependencies cache
+ uses: actions/cache@v4
+ with:
+ path: |
+ _build
+ rebar.lock
+ key: ${{ runner.os }}-rebar3-${{ hashFiles('rebar.config') }}
+ restore-keys: |
+ ${{ runner.os }}-rebar3-
- - name: Compile
- run: rebar3 compile
+ - name: Compile
+ run: rebar3 compile
- - name: Generate EDoc
- run: rebar3 edoc
+ - name: Generate EDoc
+ run: rebar3 edoc
- - name: Fix index.html for GitHub Pages
- run: cp doc/overview-summary.html doc/index.html
+ - name: Fix index.html for GitHub Pages
+ run: |
+ if [ ! -f doc/index.html ]; then
+ cp doc/overview-summary.html doc/index.html
+ echo "Copied overview-summary.html to index.html"
+ else
+ echo "index.html already exists, skipping"
+ fi
- - name: Setup Pages
- uses: actions/configure-pages@v4
+ - name: Setup Pages
+ uses: actions/configure-pages@v4
+ if: github.event_name != 'pull_request'
- - name: Upload artifact
- uses: actions/upload-pages-artifact@v3
- with:
- path: 'doc'
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v3
+ if: github.event_name != 'pull_request'
+ with:
+ path: "doc"
deploy:
name: Deploy to GitHub Pages
@@ -65,6 +80,7 @@ jobs:
needs: build
steps:
- - name: Deploy to GitHub Pages
- id: deployment
- uses: actions/deploy-pages@v4
+ - name: Deploy to GitHub Pages
+ id: deployment
+ if: github.event_name != 'pull_request'
+ uses: actions/deploy-pages@v4