Skip to content

Documentation generator #173

Documentation generator

Documentation generator #173

Workflow file for this run

name: Documentation generator
on:
schedule:
- cron: '23 1 * * 1' # Tous les lundis à 01:23 (du matin).
# A executer lorsque l'on demande.
workflow_dispatch:
jobs:
arcane_build:
name: Build Arcane and documentations
runs-on: ubuntu-latest
container:
image: ghcr.io/arcaneframework/ubuntu-2404:doc_latest
steps:
- name: Display CPU infos
shell: bash
run: |
cat /proc/cpuinfo
- name: Display disks infos
shell: bash
run: |
df -h
- name: Define environment paths
shell: bash
run: |
echo "SOURCE_DIR=${GITHUB_WORKSPACE}/framework" >> $GITHUB_ENV
echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV
echo "CCACHE_DIR=${GITHUB_WORKSPACE}/ccache" >> $GITHUB_ENV
echo "DOC_DIR=${GITHUB_WORKSPACE}/doc" >> $GITHUB_ENV
- name: Create paths
shell: bash
run: |
mkdir ${{ env.SOURCE_DIR }} \
${{ env.BUILD_DIR }} \
${{ env.CCACHE_DIR }} \
${{ env.DOC_DIR }}
- name: Checkout doc
uses: actions/checkout@v4
with:
path: ${{ env.DOC_DIR }}
- name: Display disks infos and size of directories
shell: bash
run: |
df -h
dum(){
DIR="${1:-0}"
CMDD=$(du -ahc --time --max-depth=1 "${DIR}")
grep -E -- '$(echo "${CMDD}" | tail -n1)|$' <(echo "${CMDD}" | sort -h)
}
echo "::group::SOURCE_DIR :"
dum "${{ env.SOURCE_DIR }}"
echo "::endgroup::"
echo "::group::BUILD_DIR :"
dum "${{ env.BUILD_DIR }}"
echo "::endgroup::"
echo "::group::CCACHE_DIR :"
dum "${{ env.CCACHE_DIR }}"
echo "::endgroup::"
echo "::group::DOC_DIR :"
dum "${{ env.DOC_DIR }}"
echo "::endgroup::"
- name: Remove old docs files
shell: bash
run: |
rm -rf ${{ env.DOC_DIR }}/arcane
rm -rf ${{ env.DOC_DIR }}/framework
- name: Checkout framework
uses: actions/checkout@v4
with:
repository: arcaneframework/framework
path: ${{ env.SOURCE_DIR }}
submodules: true
- name: Get date
id: get-date
shell: bash
run: echo "m_date=$(/bin/date -u '+%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Get cache for ccache tool
id: restore-cache
uses: actions/cache/restore@v4
with:
path: ${{env.CCACHE_DIR}}
key: doc-${{ env.m_date }}-${{ github.run_number }}
restore-keys: doc-
- name: Display disks infos and size of directories
shell: bash
run: |
df -h
dum(){
DIR="${1:-0}"
CMDD=$(du -ahc --time --max-depth=1 "${DIR}")
grep -E -- '$(echo "${CMDD}" | tail -n1)|$' <(echo "${CMDD}" | sort -h)
}
echo "::group::SOURCE_DIR :"
dum "${{ env.SOURCE_DIR }}"
echo "::endgroup::"
echo "::group::BUILD_DIR :"
dum "${{ env.BUILD_DIR }}"
echo "::endgroup::"
echo "::group::CCACHE_DIR :"
dum "${{ env.CCACHE_DIR }}"
echo "::endgroup::"
echo "::group::DOC_DIR :"
dum "${{ env.DOC_DIR }}"
echo "::endgroup::"
- name: Build framework
uses: arcaneframework/gh_actions/build_install_framework@v2
with:
source_dir: ${{ env.SOURCE_DIR }}
build_dir: ${{ env.BUILD_DIR }}
cache_dir: ${{ env.CCACHE_DIR }}
max_size_cache_dir: 512M
with_userdoc: true
with_devdoc: true
with_aliendoc: true
- name: Remove SOURCE_DIR
shell: bash
run: |
rm -rf ${{ env.SOURCE_DIR }}
- name: Display disks infos and size of directories
shell: bash
run: |
df -h
dum(){
DIR="${1:-0}"
CMDD=$(du -ahc --time --max-depth=1 "${DIR}")
grep -E -- '$(echo "${CMDD}" | tail -n1)|$' <(echo "${CMDD}" | sort -h)
}
echo "::group::BUILD_DIR :"
dum "${{ env.BUILD_DIR }}"
echo "::endgroup::"
echo "::group::CCACHE_DIR :"
dum "${{ env.CCACHE_DIR }}"
echo "::endgroup::"
echo "::group::DOC_DIR :"
dum "${{ env.DOC_DIR }}"
echo "::endgroup::"
- name: Move userdoc devdoc and aliendoc
shell: bash
run: |
mkdir -p ${{ env.DOC_DIR }}/arcane
mkdir -p ${{ env.DOC_DIR }}/framework
mv ${{ env.BUILD_DIR }}/share/userdoc ${{ env.DOC_DIR }}/arcane
mv ${{ env.BUILD_DIR }}/share/devdoc ${{ env.DOC_DIR }}/arcane
mv ${{ env.BUILD_DIR }}/share/aliendoc ${{ env.DOC_DIR }}/framework
- name: Remove BUILD_DIR
shell: bash
run: |
rm -rf ${{ env.BUILD_DIR }}
- name: Remove md5 and map files
shell: bash
run: |
find ${{ env.DOC_DIR }}/arcane -type f \( -name "*.md5" -o -name "*.map" \) -delete
- name: Save cache from ccache tool
id: save-cache
uses: actions/cache/save@v4
with:
path: ${{env.CCACHE_DIR}}
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
- name: Remove CCACHE_DIR
shell: bash
run: |
rm -rf ${{ env.CCACHE_DIR }}
- name: Display disks infos and size of directories
shell: bash
run: |
df -h
dum(){
DIR="${1:-0}"
CMDD=$(du -ahc --time --max-depth=1 "${DIR}")
grep -E -- '$(echo "${CMDD}" | tail -n1)|$' <(echo "${CMDD}" | sort -h)
}
echo "::group::DOC_DIR :"
dum "${{ env.DOC_DIR }}"
echo "::endgroup::"
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: main
publish_dir: ${{ env.DOC_DIR }}
force_orphan: true
exclude_assets: ''
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
- name: Display disks infos
shell: bash
run: |
df -h