Skip to content

Merge pull request #212 from sorru94/fwd-changes-from-v1.3 #60

Merge pull request #212 from sorru94/fwd-changes-from-v1.3

Merge pull request #212 from sorru94/fwd-changes-from-v1.3 #60

#
# This file is part of Astarte.
#
# Copyright 2018-2023 SECO Mind Srl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: LGPL-2.1-or-later OR Apache-2.0
#
name: Docs generation for Github Pages
on:
push:
paths:
# Headers
- 'include/*'
# Doc updates
- 'doc/*'
# The action itself
- '.github/workflows/docs-workflow.yaml'
branches:
# Create the docs only when it matters
- 'master'
- 'release-*'
jobs:
docs:
runs-on: ubuntu-latest
steps:
# Checkout the source
- uses: actions/checkout@v4
with:
path: astarte-device-sdk-esp32
# Checkout the docs repository
- uses: actions/checkout@v4
with:
repository: astarte-platform/docs
ssh-key: ${{ secrets.DOCS_DEPLOY_KEY }}
path: docs
- name: Install doxygen
run: |
sudo apt-get update
sudo apt-get -y install doxygen
- name: Build Docs
working-directory: ./astarte-device-sdk-esp32/doc
run: doxygen astarte-device-sdk-esp32.doxy
- name: Copy Docs
run: |
export DOCS_DIRNAME="device-sdks/esp32/$(echo ${{ github.ref }} | sed 's,refs/heads/,,' | sed 's/master/snapshot/g' | sed 's/release-//g')/api"
rm -rf docs/$DOCS_DIRNAME
mkdir -p docs/$DOCS_DIRNAME
cp -r astarte-device-sdk-esp32/doc/out/html/* docs/$DOCS_DIRNAME/
- name: Commit files
working-directory: ./docs
run: |
git config --local user.email "astarte-machine@ispirata.com"
git config --local user.name "Astarte Bot"
git add .
git commit -m "Update ESP32 SDK documentation"
- name: Push changes
working-directory: ./docs
run: |
git push origin master