Skip to content

Commit 5a06f1a

Browse files
authored
Create publish_sites.yml
1 parent 7af9b23 commit 5a06f1a

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and publish TED Developer Docs
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
- develop
9+
10+
jobs:
11+
publish_site:
12+
name: "Build and publish site with Antora"
13+
runs-on: [ubuntu-latest]
14+
env:
15+
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
16+
NODE_OPTIONS: '--max-old-space-size=8192'
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js for use with actions
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 18
26+
27+
- name: Install Corepack
28+
run: npm install --prefix .node corepack
29+
30+
- name: Install Yarn
31+
run: .node/node_modules/.bin/corepack enable --install-directory .node
32+
33+
- name: Install packages
34+
run: .node/yarn install
35+
36+
- name: Generate site
37+
run: yarn run build
38+
39+
- name: Deploy production (master branch)
40+
if: github.ref == 'refs/heads/master'
41+
uses: JamesIves/github-pages-deploy-action@v4
42+
with:
43+
token: "${{ github.token }}"
44+
folder: build/site
45+
branch: gh-pages
46+
commit-message: "[CI] Publish Documentation for ${{ github.sha }}"
47+
48+
- name: Deploy staging (develop branch)
49+
if: github.ref == 'refs/heads/develop'
50+
uses: JamesIves/github-pages-deploy-action@v4
51+
with:
52+
token: "${{ secrets.STAGING_TOKEN }}"
53+
repository-name: OP-TED/docs-staging
54+
folder: build/site
55+
branch: gh-pages
56+
commit-message: "[CI] Publish STAGING Docs for ${{ github.sha }}"

0 commit comments

Comments
 (0)