Skip to content

Forward port changes from v0.6 release branch #463

Forward port changes from v0.6 release branch

Forward port changes from v0.6 release branch #463

Workflow file for this run

#
# Copyright 2023 Winford (Uncle Grumpy) <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
#
# This is a workflow for atomvm/AtomVM to Publish API documentation and other content from the `doc` directory to
# atomvm.net hosted on GitHub Pages
name: Publish Docs
# Controls when the workflow will run
on:
# Triggers the workflow on pull request, tag events and pushes on main
push:
tags:
- '**'
branches:
- 'main'
- 'release-**'
paths:
- '.github/workflows/publish-docs.yaml'
- 'CMakeLists.txt'
- 'doc/**'
- 'libs/**'
- 'src/libAtomVM/**'
- 'UPDATING.md'
- 'CONTRIBUTING.md'
- 'CHANGELOG.md'
- 'CODE_OF_CONDUCT.md'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
env:
AVM_DOCS_NAME: ${{ github.ref_name }}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
## don't add more than one OS to matrix, this is only to retrieve the full os-name for keeping cache in sync
matrix:
os: [ ubuntu-24.04 ]
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
container: erlang:26.0.2
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Install Deps
run: |
apt update -y
DEBIAN_FRONTEND=noninteractive apt install -y git cmake doxygen graphviz python3-pip python3-virtualenv python3-setuptools python3-stemmer wget
- uses: actions/cache@v4
id: sphinx-cache
with:
path: /home/runner/python-env/sphinx
key: ${{ matrix.os }}-${{ job.container.id }}-sphinx-install
- name: Install Sphinx
if: ${{ steps.sphinx-cache.outputs.cache-hit != 'true' }}
run: |
virtualenv /home/runner/python-env/sphinx
. /home/runner/python-env/sphinx/bin/activate
python3 -m pip install sphinx
python3 -m pip install myst-parser
python3 -m pip install sphinx-rtd-theme
python3 -m pip install rinohtype
python3 -m pip install pillow
python3 -m pip install gitpython
python3 -m pip install breathe
python3 -m pip install pygments
- name: Install rebar3
working-directory: /tmp
run: |
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
./rebar3 local install
echo "/home/runner/.cache/rebar3/bin" >> ${GITHUB_PATH}
- uses: actions/checkout@v4
with:
repository: ${{ vars.GITHUB_REPOSITORY }}
fetch-depth: 0
- uses: actions/checkout@v4
id: checkout-production
with:
repository: atomvm/atomvm_www
ref: Production
path: /home/runner/work/AtomVM/AtomVM/www
- name: Track all branches
shell: bash
run: |
git config --global --add safe.directory /__w/AtomVM/AtomVM
for branch in `git branch -a | grep "remotes/origin" | grep -v HEAD | grep -v "${{ github.ref_name }}" `; do
git branch --track ${branch#remotes/origin/} $branch
done
- name: Build Site
shell: bash
run: |
. /home/runner/python-env/sphinx/bin/activate
mkdir build
cd build
cmake ..
cd doc
make GitHub_CI_Publish_Docs
rm -frv "/__w/AtomVM/AtomVM/www/doc/${{ github.ref_name }}"
cp -av html "/__w/AtomVM/AtomVM/www/doc/${{ github.ref_name }}"
- name: Commit files
id: commit_files
if: github.repository == 'atomvm/AtomVM'
working-directory: /home/runner/work/AtomVM/AtomVM/www
run: |
git config --local user.email "[email protected]"
git config --local user.name "AtomVM Doc Bot"
ls -la doc/
git status "doc/${{ github.ref_name }}"
git add "doc/${{ github.ref_name }}"
git add .
git diff --exit-code Production || echo "Going to commit"
git diff --exit-code Production || git commit -m "Update Documentation"
git log -1
- name: Push changes
if: github.repository == 'atomvm/AtomVM'
working-directory: /home/runner/work/AtomVM/AtomVM/www
run: |
export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no"
eval `ssh-agent -t 60 -s`
echo "${{ secrets.PUBLISH_ACTION_KEY }}" | ssh-add -
mkdir -p ~/.ssh/
echo "github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl" > ~/.ssh/known_hosts
echo "github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=" >> ~/.ssh/known_hosts
echo "github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=" >> ~/.ssh/known_hosts
git remote add push_dest "[email protected]:atomvm/atomvm_www.git"
git fetch push_dest
git diff --exit-code push_dest/Production || echo "Going to push"
git diff --exit-code push_dest/Production || git push --set-upstream push_dest Production