Skip to content

Pages

Pages #271

Workflow file for this run

name: Pages
on:
workflow_run:
workflows: [Publish results]
types: [completed]
workflow_dispatch:
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
name: Build docs
runs-on: ubuntu-latest
if: >-
${{ github.event_name != 'workflow_run' ||
github.event.workflow_run.head_branch == 'main' }}
permissions:
contents: read
env:
MIX_ENV: dev
steps:
- name: 馃摜 Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_run' && 'main' || github.ref }}
- name: 馃敡 Setup Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.19.4'
otp-version: '28.1'
- name: 馃摝 Cache dependencies
uses: actions/cache@v6
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-docs-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-docs-
- name: 馃敤 Install dependencies
run: |
# Retry: the Hex registry occasionally drops the connection mid-fetch (transient, and worse on a
# cache miss when every dep downloads at once). Fail only if all attempts fail.
for i in 1 2 3; do
mix deps.get && exit 0
echo "mix deps.get failed (attempt $i/3)"
if [ "$i" -lt 3 ]; then sleep 5; fi
done
exit 1
- name: 馃摑 Generate documentation
run: mix docs
- name: 鈿欙笍 Configure Pages
uses: actions/configure-pages@v6
- name: 馃摛 Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: doc/
deploy:
name: Deploy to Pages
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: 馃殌 Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5