Repository navigation
93 lines (73 loc) · 2.03 KB
/
Copy pathdeploy-preview.yml
File metadata and controls
93 lines (73 loc) · 2.03 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Deploy-preview
on:
push:
branches:
- '*'
- '!master'
- '!main'
jobs:
build-honkit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: actions/setup-node@v3
with:
node-version: '22'
- run: npm install -g honkit gitbook-plugin-include gitbook-plugin-toggle-chapters gitbook-plugin-git-author
- name: Build HonKit books
run: .github/bin/buildHonkit.sh
- uses: actions/upload-artifact@v4
with:
name: build-honkit
path: build/
build-gitbook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: actions/setup-node@v1
- run: npm install -g gitbook-cli
- name: Build GitBook books
run: .github/bin/buildGitbook.sh
- uses: actions/upload-artifact@v4
with:
name: build-gitbook
path: build/
deploy:
runs-on: ubuntu-latest
needs: [build-honkit, build-gitbook]
environment:
name: 'staging'
url: "https://preview.iiif.io/training/${{ github.ref_name}}/index.html"
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: actions/setup-node@v1
- run: npm install -g marked@v3.0.8
- uses: actions/download-artifact@v4
with:
name: build-honkit
path: build/
- uses: actions/download-artifact@v4
with:
name: build-gitbook
path: build/
- name: Convert index
run: .github/bin/createIndex.sh
- name: Update lastmod
run: .github/bin/updateLastMod.sh
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::420715881449:role/GithubIdentify
aws-region: us-east-1
- name: Copy files to preview
run: |
aws s3 sync build/ s3://preview.iiif.io/training/${{ github.ref_name}} --acl 'public-read'