-
Notifications
You must be signed in to change notification settings - Fork 19
101 lines (83 loc) · 2.71 KB
/
developer.yml
File metadata and controls
101 lines (83 loc) · 2.71 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
94
95
96
97
98
99
100
101
name: Publish
on:
workflow_dispatch:
repository_dispatch:
push:
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: '16'
# Build Content
- run: npm install
- run: npm run lint
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout labs-pages
uses: actions/checkout@v3
with:
repository: neo4j-documentation/labs-pages
ref: publish
path: labs-pages-local
- name: Checkout neo4j-agent-integrations
uses: actions/checkout@v3
with:
repository: neo4j-labs/neo4j-agent-integrations
ref: main
path: agent-integrations
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Generate agent integration pages
run: |
pip install pyyaml
python3 agent-integrations/scripts/publish-to-labs.py \
--convert \
--labs-pages-dir labs-pages-local
- name: Patch labs.yml to use local labs-pages checkout
run: |
sed -i 's|url: https://github.com/neo4j-documentation/labs-pages.git|url: ./labs-pages-local|g' labs.yml
sed -i 's|branches: publish|branches: HEAD|g' labs.yml
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm install
- run: npm run build:production
# Move _ to static/assets
- run: mkdir -p build/site/static
- run: mv build/site/_ build/site/static/assets
# Sync all files to S3
- name: Sync to Static
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --exclude 'build/site/developer/index.html'
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_S3_REGION }}
SOURCE_DIR: 'build/site/'
- name: Invalidate CloudFront Cache
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ vars.AWS_CLOUDFRONT_DISTRIBUTION }}
PATHS: "/labs/* /developer/*"
AWS_REGION: ${{ secrets.AWS_S3_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# Index into Algolia
# - run: npm run index
# env:
# ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
# ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
# ALGOLIA_INDEXES: ${{ secrets.ALGOLIA_INDEXES }}