-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.23 KB
/
build.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
name: Build and Deploy
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
#
# Preparation
#
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Node.js and NPM
uses: actions/setup-node@v4
with:
node-version: '20'
#
# Retrieve album data
#
- name: Downlad album data generator
env:
SPOTIFY_ALBUM_REPO_ACCESS_TOKEN: ${{ secrets.SPOTIFY_ALBUM_REPO_ACCESS_TOKEN }}
run:
./generate-album-data
#
# Build the actual elm app
#
- name: Install dependencies
run: npm install
- name: Install uglifyjs
run: npm install -g uglify-js
- name: Install elm
run: npm install -g elm
- name: Build project
run: elm make src/Main.elm --optimize --output main.js
- name: Minify JS
run: uglifyjs main.js --compress 'pure_funcs=[F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9],pure_getters,keep_fargs=false,unsafe_comps,unsafe' | uglifyjs --mangle --output dist/js/main.js
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist
keep_files: true