-
Notifications
You must be signed in to change notification settings - Fork 96
69 lines (59 loc) · 1.91 KB
/
netlify.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
62
63
64
65
66
67
68
name: Build Netlify Preview
on:
pull_request_target:
branches: [ master ]
paths:
- markdown/**
jobs:
Build_Preview:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20.5'
- name: Install node 12.x
uses: actions/setup-node@v1
with:
node-version: 12.16.2
- name: Checkout Current Commit
uses: actions/checkout@master
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
path: main
- name: Checkout claat repo
uses: actions/checkout@v2
with:
repository: SolaceDev/google-tools
path: google-tools
- name: Checkout site repo
uses: actions/checkout@v2
with:
repository: SolaceDev/solace-dev-codelabs-site
submodules: recursive
path: codelabs-site
- name: Build claat
run: cd google-tools/claat; go build .
- name: Get all changed markdown files
id: changed-markdown-files
uses: tj-actions/changed-files@v40
with:
files: |
**.md
path: main
- name: Export markdown files into site dir
run: |
for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do
folder="$(basename $file .md)"
google-tools/claat/claat export -o codelabs-site/site/solace-dev-codelabs/codelabs main/$file
done
cd codelabs-site/site && npm i && npm run dist
- name: Netlify Deploy
uses: nwtgck/[email protected]
with:
publish-dir: 'codelabs-site/site/dist'
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}