Skip to content

Commit 615f9de

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 fc4eaf8 commit 615f9de

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

.github/workflows/publish_docs.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
26+
build:
27+
runs-on: ubuntu-24.04
28+
container: erlang:28
29+
steps:
30+
31+
- name: "Checkout code"
32+
uses: actions/checkout@v5
33+
34+
- name: "Setup Pages"
35+
uses: actions/configure-pages@v5
36+
37+
- name: "Build Docs"
38+
run: |
39+
rebar3 as doc ex_doc
40+
41+
- name: Upload pages artifact
42+
## Must use v3 for now due to issue actions/deploy-pages#389
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
name: github-pages
46+
path: ./docs
47+
48+
deploy:
49+
# Add a dependency to the build job
50+
needs: build
51+
52+
# Deploy to the github-pages environment
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
57+
# Specify runner + deployment step
58+
runs-on: ubuntu-24.04
59+
steps:
60+
61+
- name: "Setup Pages"
62+
uses: actions/configure-pages@v5
63+
64+
- name: Deploy to GitHub Pages
65+
if: ${{ github.repository == 'atomvm/atomvm_rebar3_plugin' }}
66+
id: deployment
67+
uses: actions/deploy-pages@v4

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
A [`rebar3`](https://rebar3.org) plugin for simplifying development of Erlang applications targeted for the [AtomVM](http://github.com/atomvm/AtomVM) Erlang abstract machine.
99

10+
[Releases](https://hex.pm/packages/atomvm_rebar3_plugin) and
11+
[accompanying documentation](https://hexdocs.pm/atomvm_rebar3_plugin/readme.html) are available on
12+
[hex.pm](https://hex.pm). The documentation for the current master branch is always available from
13+
the [`atomvm_rebar3_plugin` GitHub pages](https://atomvm.github.io/atomvm_rebar3_plugin/readme.html).
14+
1015
## Quick Start
1116

1217
Create or edit the `$HOME/.config/rebar3/rebar.config` file to include the `atomvm_rebar3_plugin` [`rebar3`](https://rebar3.org) plugin:

0 commit comments

Comments
 (0)