Skip to content

Merge pull request #48 from useblocks/docs_theme #3

Merge pull request #48 from useblocks/docs_theme

Merge pull request #48 from useblocks/docs_theme #3

Workflow file for this run

# *******************************************************************************
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
name: Documentation build
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main
merge_group:
types: [checks_requested]
jobs:
docs-build:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.9.1
- name: Build documentation
run: |
bazel build //docs:github-pages && cp bazel-bin/docs/github-pages.tar .
- name: Upload artifact for deployment
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4.4.0
with:
name: github-pages
path: ${{ github.workspace }}/github-pages.tar
retention-days: 1
if-no-files-found: error
- name: Upload artifact for pull request link
if: github.event_name == 'pull_request'
id: upload-artifact-pr
uses: actions/upload-artifact@v4.4.0
with:
name: github-pages-${{ github.sha }}
path: ${{ github.workspace }}/github-pages.tar
retention-days: 1
if-no-files-found: error
- name: Comment artifact URL
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
run: |
gh pr comment ${{ github.event.pull_request.number }} \
--body "Documentation artifact: ${{ steps.upload-artifact-pr.outputs.artifact-url }}"
env:
GH_TOKEN: ${{ github.token }}
docs-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: docs-build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4.0.5