-
Notifications
You must be signed in to change notification settings - Fork 90
204 lines (194 loc) · 7.8 KB
/
build-deploy-docs.yml
File metadata and controls
204 lines (194 loc) · 7.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: 🥘 Build & Deploy Docs HB
on:
pull_request:
branches:
- main
paths:
# Trigger on changes to docs, mkdocs config, or the workflow itself
- "docs/**"
- "mkdocs.yml"
- ".github/workflows/build-deploy-docs.yml"
push:
branches:
- main
paths:
# Trigger on changes to docs, mkdocs config, or the workflow itself
- "docs/**"
- "mkdocs.yml"
- ".github/workflows/build-deploy-docs.yml"
# Perform a release using a workflow dispatch
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
# Run the build as part of PRs to confirm the site properly builds
check_build:
if: ${{ startsWith(github.ref, 'refs/pull/') }}
runs-on: ubuntu-22.04
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
# Setup Python environment
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Use a recent Python 3 version
# Install Erlang OTP 27 using kerl
- name: Install Erlang OTP 27
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf libncurses5-dev libssl-dev
git clone https://github.com/kerl/kerl.git
./kerl/kerl build 27.0 otp-27.0
./kerl/kerl install otp-27.0 ~/otp-27.0
echo '. ~/otp-27.0/activate' >> ~/.bashrc
. ~/otp-27.0/activate
echo "Erlang version:"
erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
# Install system dependencies needed for HyperBEAM
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
build-essential \
cmake \
pkg-config \
ncurses-dev \
libssl-dev \
ca-certificates
# Debug step - display the region with syntax error
- name: Debug syntax error region
run: |
echo "Showing the region with syntax error in hb_message.erl:"
sed -n '1440,1460p' src/hb_message.erl || echo "File not found or cannot be read"
echo "Checking for syntax error fix files:"
find . -name "*.erl.fix" -o -name "hb_message.erl.*" | grep -v ".beam" || echo "No fix files found"
echo "Erlang version:"
. ~/otp-27.0/activate && erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
# Install rebar3
- name: Install rebar3
run: |
. ~/otp-27.0/activate
mkdir -p ~/.config/rebar3
curl -O https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
sudo mv rebar3 /usr/local/bin/rebar3
. ~/otp-27.0/activate && rebar3 --version
# Install Rust toolchain (needed for WASM components)
- name: Install Rust and Cargo
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
source "$HOME/.cargo/env"
# Setup Node.js
- name: ⎔ Setup Node
uses: actions/setup-node@v3
with:
node-version: 22 # Or your preferred version
# Install pip dependencies and cache them
- name: 📦 Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
- name: 🛠 Build Docs
run: |
. ~/otp-27.0/activate
SKIP_COMPILE=1 SKIP_EDOC=1 ./docs/build-all.sh -v
# Build and deploy the artifacts to Arweave via ArDrive
deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these deployments to complete.
concurrency:
group: deploy
cancel-in-progress: false
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
# Setup Python environment
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
# Install Erlang OTP 27 using kerl
- name: Install Erlang OTP 27
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf libncurses5-dev libssl-dev
git clone https://github.com/kerl/kerl.git
./kerl/kerl build 27.0 otp-27.0
./kerl/kerl install otp-27.0 ~/otp-27.0
echo '. ~/otp-27.0/activate' >> ~/.bashrc
. ~/otp-27.0/activate
echo "Erlang version:"
erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
# Install system dependencies needed for HyperBEAM
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
build-essential \
cmake \
pkg-config \
ncurses-dev \
libssl-dev \
ca-certificates
# Debug step - display the region with syntax error
- name: Debug syntax error region
run: |
echo "Showing the region with syntax error in hb_message.erl:"
sed -n '1440,1460p' src/hb_message.erl || echo "File not found or cannot be read"
echo "Checking for syntax error fix files:"
find . -name "*.erl.fix" -o -name "hb_message.erl.*" | grep -v ".beam" || echo "No fix files found"
echo "Erlang version:"
. ~/otp-27.0/activate && erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
# Install rebar3
- name: Install rebar3
run: |
. ~/otp-27.0/activate
mkdir -p ~/.config/rebar3
curl -O https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
sudo mv rebar3 /usr/local/bin/rebar3
. ~/otp-27.0/activate && rebar3 --version
# Install Rust toolchain (needed for WASM components)
- name: Install Rust and Cargo
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
source "$HOME/.cargo/env"
# Install pip dependencies and cache them
- name: 📦 Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
# Setup Node.js (needed for npx deploy command)
- name: ⎔ Setup Node
uses: actions/setup-node@v3
with:
node-version: 22 # Or your preferred version
- name: 👀 Env
run: |
echo "Event name: ${{ github.event_name }}"
echo "Git ref: ${{ github.ref }}"
echo "GH actor: ${{ github.actor }}"
echo "SHA: ${{ github.sha }}"
VER=`node --version`; echo "Node ver: $VER"
VER=`npm --version`; echo "npm ver: $VER"
. ~/otp-27.0/activate && erl -eval 'io:format("Erlang OTP version: ~s~n", [erlang:system_info(otp_release)]), halt().'
- name: 🛠 Build Docs
id: build_artifacts
run: |
. ~/otp-27.0/activate
SKIP_COMPILE=1 SKIP_EDOC=1 ./docs/build-all.sh -v
touch mkdocs-site/.nojekyll
echo "artifacts_output_dir=mkdocs-site" >> $GITHUB_OUTPUT
- name: 💾 Publish to Arweave
id: publish_artifacts
run: |
npx permaweb-deploy \
--arns-name=dps-testing-facility \
--ant-process=${{ secrets.ANT_PROCESS }} \
--deploy-folder=${ARTIFACTS_OUTPUT_DIR}
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
ARTIFACTS_OUTPUT_DIR: ${{ steps.build_artifacts.outputs.artifacts_output_dir }}
ANT_PROCESS: ${{ secrets.ANT_PROCESS }}