new-horizons/.github/workflows/docs_build.yml
2023-11-29 14:09:40 -05:00

53 lines
1.2 KiB
YAML

name: Build Docs
on:
workflow_call:
inputs:
schemas_artifact:
description: "Name of the artifact that has updated schemas, set to `null` to not update"
default: "null"
required: false
type: string
push:
branches: [main]
paths:
- docs/**
- NewHorizons/Schemas/*
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Schemas
if: ${{ inputs.schemas_artifact != 'null' }}
uses: actions/download-artifact@v3
with:
name: ${{ inputs.schemas_artifact }}
path: NewHorizons/Schemas
- name: Build Site
uses: withastro/action@v1
with:
path: ./docs
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1