Skip to content

Commit eea4547

Browse files
authored
Merge pull request #74 from OP-TED/yfanti-patch-1
Create publish_sites.yml
2 parents 7af9b23 + eab0b38 commit eea4547

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)