Skip to content

STAGING - Build and publish TED Developer Docs #33

STAGING - Build and publish TED Developer Docs

STAGING - Build and publish TED Developer Docs #33

name: STAGING - Build and publish TED Developer Docs
on:
workflow_dispatch:
push:
branches:
- develop
jobs:
publish_site:
name: "Build and publish site with Antora"
runs-on: [ubuntu-latest]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
NODE_OPTIONS: '--max-old-space-size=8192'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js for use with actions
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Corepack
run: npm install --prefix .node corepack
- name: Install Yarn
run: .node/node_modules/.bin/corepack enable --install-directory .node
- name: Install packages
run: .node/yarn install
- name: Generate site
run: yarn run build
# Authenticate with GitHub App
- name: Generate GitHub App token
id: app-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: ${{ secrets.INSTALLATION_ID }}
- name: Deploy staging (develop branch)
if: github.ref == 'refs/heads/develop'
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: OP-TED/docs-staging
folder: build/site
branch: gh-pages
token: ${{ steps.app-token.outputs.token }}
commit-message: "[CI] Publish STAGING Docs for ${{ github.sha }}"