Skip to content

Commit a5eb7f9

Browse files
committed
Add workflow automation to publish docs
Automates the publication of documentation to github pages when changes are merged to the master branch. This will keep the github pages in sync with the master barnch and users can use the docs published to hex.pm for release versions. Signed-off-by: Winford <[email protected]>
1 parent eadd0f4 commit a5eb7f9

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

.github/workflows/publish_docs.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#
2+
# Copyright 2025 Winford (Uncle Grumpy) <[email protected]>
3+
#
4+
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
5+
#
6+
# This is a workflow for atomvm/atomvm_packbeam to publish documentation to GitHub Pages
7+
8+
name: Publish Docs
9+
10+
on:
11+
# Triggers the workflow on tags
12+
push:
13+
branches:
14+
- 'master'
15+
16+
# Allows you to run this workflow manually from the Actions tab
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
pages: write
22+
id-token: write
23+
24+
jobs:
25+
build:
26+
runs-on: ubuntu-24.04
27+
28+
steps:
29+
- name: "Install deps"
30+
run: |
31+
sudo apt install -y make git
32+
33+
- uses: erlef/setup-beam@v1
34+
with:
35+
otp-version: "28"
36+
37+
- name: "Build rebar3"
38+
run: |
39+
cd /tmp
40+
git clone https://github.com/erlang/rebar3.git
41+
cd rebar3
42+
./bootstrap
43+
44+
- name: "Checkout code"
45+
uses: actions/checkout@v4
46+
with:
47+
repository: ${{ vars.GITHUB_REPOSITORY }}
48+
fetch-depth: 0
49+
50+
- name: "Setup Pages"
51+
uses: actions/configure-pages@v5
52+
53+
- name: "Build Docs"
54+
run: |
55+
PATH="/tmp/rebar3:${PATH}" make doc
56+
57+
- name: Upload docs artifact
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: github-pages
61+
path: ./docs
62+
if-no-files-found: error
63+
64+
deploy:
65+
# Add a dependency to the build job
66+
needs: build
67+
68+
# Deploy to the github-pages environment
69+
environment:
70+
name: github-pages
71+
url: ${{ steps.deployment.outputs.page_url }}
72+
73+
# Specify runner + deployment step
74+
runs-on: ubuntu-24.04
75+
steps:
76+
- name: Deploy to GitHub Pages
77+
if: ${{ github.repository == 'atomvm/atomvm_packbeam' }}
78+
id: deployment
79+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)