forked from modelica/fmi-guides
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (59 loc) · 2.3 KB
/
build-guides.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
name: Build Guides
on:
push:
branches-ignore: [ 'temp/*' ]
pull_request:
branches: [ main ]
jobs:
build-guides:
name: Build FMI Guides
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: prepare
run: mkdir build && mkdir build/fmi-guide && mkdir build/ls-bus-guide && mkdir build/fmi-profiles
- name: build implementers guide
uses: avattathil/asciidoctor-action@master
with:
program: "asciidoctor -D build/fmi-guide --backend=html5 --attribute=revnumber=${GITHUB_REF#refs/heads/}-$GITHUB_SHA --attribute=revdate=$(date +%F) fmi-guide/index.adoc"
- name: build LS-BUS implementers guide
uses: avattathil/asciidoctor-action@master
with:
program: "asciidoctor -D build/ls-bus-guide --backend=html5 --attribute=revnumber=${GITHUB_REF#refs/heads/}-$GITHUB_SHA --attribute=revdate=$(date +%F) ls-bus-guide/index.adoc"
- name: build FMI profiles
uses: avattathil/asciidoctor-action@master
with:
program: "asciidoctor -D build/fmi-profiles --backend=html5 --attribute=revnumber=${GITHUB_REF#refs/heads/}-$GITHUB_SHA --attribute=revdate=$(date +%F) fmi-profiles/index.adoc"
- name: copy images
run: tar cf - fmi-guide/images ls-bus-guide/images fmi-profiles/images | tar xfC - build
- name: archive implementers guide
uses: actions/upload-artifact@v3
with:
name: FMI-Guide
path: build/fmi-guide/*
if-no-files-found: error
- name: archive LS-BUS implementers guide
uses: actions/upload-artifact@v3
with:
name: LS-BUS-Guide
path: build/ls-bus-guide/*
if-no-files-found: error
- name: archive FMI profiles
uses: actions/upload-artifact@v3
with:
name: FMI-Profiles
path: build/fmi-profiles/*
if-no-files-found: error
- name: extract branch name
id: extract_branch
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
- name: deploy
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build
destination_dir: ${{ steps.extract_branch.outputs.branch }}
enable_jekyll: true