Skip to content

Commit 50f714e

Browse files
authored
deploy latest docs to github pages (#3606)
inspired by https://bsky.app/profile/zachdaniel.dev/post/3lea2llgvcc2j
1 parent ec34461 commit 50f714e

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/docs.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-22.04
16+
env:
17+
elixir: 1.18.1
18+
otp: 27.2
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Elixir
24+
uses: erlef/setup-beam@v1
25+
with:
26+
elixir-version: ${{ env.elixir }}
27+
otp-version: ${{ env.otp }}
28+
29+
- name: Restore deps and _build cache
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
deps
34+
_build
35+
key: ${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}-${{ hashFiles('**/mix.lock') }}-docs
36+
restore-keys: |
37+
${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}-
38+
- name: Install Dependencies
39+
run: mix deps.get --only docs
40+
41+
- name: Build docs
42+
run: mix docs
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v2
46+
with:
47+
path: doc/
48+
49+
# Deployment job
50+
deploy:
51+
environment:
52+
name: github-pages
53+
url: ${{steps.deployment.outputs.page_url}}
54+
runs-on: ubuntu-latest
55+
needs: build
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)