Skip to content

Commit 934474c

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 b23cf0c commit 934474c

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/publish_docs.yml

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

0 commit comments

Comments
 (0)