-
Notifications
You must be signed in to change notification settings - Fork 220
68 lines (54 loc) · 1.53 KB
/
preview_create.yml
File metadata and controls
68 lines (54 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Preview Create/Update
on:
create:
branches-ignore:
- 'main'
- 'develop'
- 'tinymce/**'
- 'release/**'
- 'archived/**'
push:
branches-ignore:
- 'main'
- 'develop'
- 'tinymce/**'
- 'release/**'
- 'archived/**'
jobs:
build:
name: Update Docs Preview
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./.github/workflows/scripts
steps:
- name: Checkout branch
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
cache: 'yarn'
node-version: 24
- name: Install dependencies
run: yarn install
- name: Build Website
run: yarn antora ./antora-playbook.yml
- name: Rename sitemap.xml
run: |
mv ./build/site/sitemap.xml ./build/site/antora-sitemap.xml
- name: Convert branch into subdomain
id: get-subdomain
run: |
node ./branch-to-subdomain.js | { read s; echo "subdomain=$s" } >> $GITHUB_OUTPUT
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v5.0.0
with:
role-to-assume: arn:aws:iam::327995277200:role/staging-docs-preview-update
role-session-name: docs-preview-update
aws-region: us-east-2
- name: Upload website preview to S3
run: |
aws s3 sync --delete ./build/site s3://tiny-cloud-antora-docs-preview/${SUBDOMAIN}/docs
env:
SUBDOMAIN: ${{ steps.get-subdomain.outputs.subdomain }}