-
Notifications
You must be signed in to change notification settings - Fork 220
61 lines (52 loc) · 1.7 KB
/
develop_6_docs.yml
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
name: Develop 6 Docs
on:
workflow_dispatch:
push:
paths:
- '**'
branches:
- 'feature/**'
- 'hotfix/**'
- 'release/**'
- 'staging/**'
jobs:
build:
name: Build Docs and Deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [21]
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: 'yarn'
node-version: ${{ matrix.node-version }}
- name: (Develop 6 Docs) Install dependencies
run: yarn install
- name: (Develop 6 Docs) Build API References
run: yarn build
- name: (Develop 6 Docs) Build Website
run: yarn antora ./antora-playbook.yml
- name: (deploy) Prepare for branch deployments
shell: bash
run: |
printf "User-agent: * \nDisallow: /\n" > ./build/site/robots.txt
S3_BUCKET=$(node -e 'console.log(`s3://docs-${process.env.GITHUB_REF.replace("refs/heads/","").replace(/[/\s]/g, "-").replace(/[^0-9a-zA-Z-]/g, "").replace(/-$/g, "").toLowerCase()}.staging.tiny.cloud`)')
printf "S3_BUCKET: ${S3_BUCKET} (${#S3_BUCKET})\n"
if [ ${#S3_BUCKET} -lt 3 ]
then
echo "WARNING! S3_BUCKET name is too short"
fi
if [ ${#S3_BUCKET} -gt 63 ]
then
echo "WARNING! S3_BUCKET name is too long"
fi
echo $S3_BUCKET > S3_BUCKET
- name: (deploy) Upload website to S3
run: aws s3 sync --acl=public-read --delete ./build/site $(cat S3_BUCKET)/docs
env:
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: true