-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.47 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
58
59
60
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: Generate artist and album files
env:
SPOTIFY_ALBUM_REPO_ACCESS_TOKEN: ${{ secrets.SPOTIFY_ALBUM_REPO_ACCESS_TOKEN }}
ALBUM_SHUFFLER_GENERATOR_SOURCE_URL: ${{ vars.SOURCE_URL }}
ALBUM_SHUFFLER_GENERATOR_ARTIST_DETAILS_URL: ${{ vars.ARTIST_DETAILS_URL }}
ALBUM_SHUFFLER_GENERATOR_ALBUMS_URL: ${{ vars.ALBUMS_URL }}
run:
./generate-album-data; tree
#
# Build the actual elm app
#
- name: Install dependencies
run: npm install --production
- 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