-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
96 lines (88 loc) · 3.01 KB
/
action.yaml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: 'Firebase Build & Deploy'
description: 'Firebase Build & Deploy'
inputs:
repoToken: # id of input
description: 'GitHub Repo Token'
required: true
default: ''
firebaseProjectId: # id of input
description: 'Firebase projectId'
required: true
default: ''
firebaseServiceAccount: # id of input
description: 'Firebase service account'
required: true
default: ''
firebaseChannelId: # id of input
description: 'Firebase channelId'
required: true
default: ''
fontawesomeNpmRegistryToken: # id of input
description: 'FontAwesome pro npm registry token'
required: true
default: ''
gfzmNpmRegistryToken: # id of input
description: 'GFZM pro npm registry token'
required: true
default: ''
beyondAgenturNpmRegistryToken: # id of input
description: 'beyondAgentur pro npm registry token'
required: true
default: ''
theme: # id of input
description: 'hugo theme to build'
required: true
default: ''
runs:
using: "composite"
steps:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set Registries
run: |
npm config set "@fortawesome:registry" https://npm.fontawesome.com
npm config set "//npm.fontawesome.com/:_authToken" ${{ inputs.fontawesomeNpmRegistryToken }}
npm config set "@gfzm:registry" https://npm.gfzm.de/registry/
npm config set "//npm.gfzm.de/registry/:_authToken" ${{ inputs.gfzmNpmRegistryToken }}
npm config set "@beyond-agentur:registry" https://npm.beyond-agentur.com/registry/
npm config set "//npm.beyond-agentur.com/registry/:_authToken" ${{ inputs.beyondAgenturNpmRegistryToken }}
- name: Install Dependencies
run: npm install
- name: Install theme base Dependencies
working-directory: themes/base
run: npm install
- name: Install theme dsb Dependencies
working-directory: themes/${{ inputs.theme }}
run: npm install
- name: Build
run: HUGO_ENV=production hugo --minify
- name: Minfiy stuff
run: npm run build
- name: Deploy to firebase
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ inputs.repoToken }}'
firebaseServiceAccount: '${{ inputs.firebaseServiceAccount }}'
channelId: ${{ inputs.firebaseChannelId }}
projectId: ${{ inputs.firebaseProjectId }}
env:
FIREBASE_CLI_PREVIEWS: hostingchannels