Skip to content

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #6112

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #6112

Workflow file for this run

# Github worflow to build and upload the documentation to Github pages.
#
# Note: This is a separate action to avoid re-triggering it on error
# in the "main" CI workflow, as errors there are mostly in the testing
# phase, not the building phase.
#
# This only needs to run on Linux, but still need to install dependencies
# and the compiler because DDOX does a full build
name: Documentation
on: [push, pull_request]
jobs:
doc:
name: Build and upload documentation
if: github.repository == 'bosagora/agora'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
# Checkout this repository and its submodules
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
# Install the D compiler
- name: Prepare compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: ldc-1.28.1
- name: 'Install dependencies & setup environment'
run: |
sudo apt-get update
sudo apt-get install libsqlite3-dev
sudo apt-get install libsodium-dev
sudo apt-get install clang
- name: Build documentation
run: |
AGORA_VERSION=HEAD dub build -b ddox
# Filter out libraries
# `x:ddocFilterArgs` in `dub.json` does not seem to work,
# so we do it manually
jq '[ .[] | select(.file|startswith("source/")) ]' docs.json > docs.filtered.json
# Generate the HTML to docs
dub run ddox -- generate-html --file-name-style=lowerUnderscored docs.filtered.json ./docs/
- name: Upload documentation artifact
uses: actions/upload-artifact@v2
with:
name: documentation
path: docs/
- name: Deploy documentation
if: github.event_name == 'push'
run: |
# Remove gh-branch if it already exists, check it out
git branch -D gh-pages || true
git checkout --orphan gh-pages
# Remove all staged files - We only need the docs
git rm -rf $(git ls-files)
# We can have some leftover files (e.g. build)
# So add docs (which is only what we need), then `git mv` it.
git add docs/
git mv -k docs/* ./
# Configure user (because persist-credentials does not persist everything...)
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
# We're done
git commit -m "Documentation for commit ${{ github.sha }}"
git push -f ${{ github.event.repository.clone_url }} gh-pages:gh-pages