-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.68 KB
/
deploy-to-gh-pages.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
name: Build and Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
persist-credentials: false
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Build Production Versions
run: |
sudo apt-get update
sudo apt-get install rsync -y
sudo apt-get install xsltproc -y
rsync dev/index.xml build/
rsync dev/index.xsl build/
rsync --recursive dev/exposes build/
rsync --recursive dev/assets build/
npm install clean-css-cli uglify-js -g
cat dev/assets/js/* | uglifyjs -o build/assets/js/main.min.js
cleancss -o build/assets/css/main.min.css dev/assets/css/build.css
cleancss -o build/assets/css/theme.min.css dev/assets/css/theme/build.css
cleancss -o build/assets/css/utilities.min.css dev/assets/css/utilities/build.css
cleancss -o build/assets/css/patterns.min.css dev/assets/css/patterns/build.css
xsltproc dev/index.xml > build/index.html
cd dev
find exposes -name index.xml | awk '{system("xsltproc assets/templates/progressive.xsl " $1 " > ../build/$(dirname " $1 ")/index.html && xsltproc assets/templates/diagrams.xsl " $1 " > ../build/$(dirname " $1 ")/diagrams.html")}'
cd ..
- name: Deploy to Github Pages
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: build
keep_files: true