Skip to content

Commit

Permalink
Create build-documentation.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
arielswalker authored Sep 6, 2024
1 parent 934f391 commit 11f7e7a
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: cFS Documentation and Guides

on:
push:
pull_request:
workflow_dispatch:

jobs:
# Checks for duplicate actions. Skips push actions if there is a matching or
# duplicate pull-request action.
checks-for-duplicates:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: 'same_content'
skip_after_successful_duplicate: 'true'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'

checkout-and-cache:
name: Custom checkout and cache for cFS documents
needs: checks-for-duplicates
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'main') }}
runs-on: ubuntu-latest

steps:
- name: Checkout bundle
uses: actions/checkout@v3
with:
repository: nasa/cFS
submodules: true

- name: Checkout submodule
uses: actions/checkout@v3
with:
path: cfe

- name: Cache Source and Build
id: cache-src-bld
uses: actions/cache@v3
with:
path: /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/*
key: cfs-doc-${{ github.run_number }}

- name: Use action based on condition
if: ${{ github.repository_owner != 'cFS' }}
uses: arielswalker/cFS/build-document@main

- name: Use different action based on condition
if: ${{ env.CUSTOM_CONDITION == 'cFS' }}
uses: my-org/action-b@viksdghk1

build-cfe-usersguide:
needs: checkout-and-cache
name: Build and deploy cFE Docs
uses: nasa/cFS/.github/workflows/build-deploy-doc.yml@main
with:
target: "[\"cfe-usersguide\"]"
cache-key: cfs-doc-${{ github.run_number }}
buildpdf: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
deploy: false # Note can't use cache with deploy, deploy in following job instead

build-mission-doc:
needs: checkout-and-cache
name: Build Mission Doc
#uses: nasa/cFS/.github/workflows/build-deploy-doc.yml
uses: nasa/cFS/.github/workflows/build-deploy-doc.yml@main
with:
target: "[\"mission-doc\"]"
cache-key: cfs-doc-${{ github.run_number }}
deploy: false
buildpdf: false # No need for mission pdf within cFE, done at bundle level

deploy-documentation:
needs: build-cfe-usersguide
if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
name: Deploy documentation to gh-pages
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3

- name: Display structure of downloaded files
run: ls -R

- name: Move pdfs to deployment directory
run: mkdir deploy; mv */*.pdf deploy

- name: Deploy to GitHub
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: deploy
SINGLE_COMMIT: true

0 comments on commit 11f7e7a

Please sign in to comment.