-
-
Notifications
You must be signed in to change notification settings - Fork 61
57 lines (51 loc) · 1.54 KB
/
publish_web.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: Publish Web
on:
workflow_call:
inputs:
build-flavor:
required: true
type: string
build-title:
required: true
type: string
secrets:
NETLIFY_AUTH_TOKEN:
required: true
jobs:
netlify:
name: Netlify
runs-on: ubuntu-latest
steps:
- name: Setup Environment
uses: JagandeepBrar/lunasea/.github/actions/prepare_for_deployment@master
with:
channel: netlify
- name: Download Web Package
uses: actions/download-artifact@v3
with:
name: web-hosted
path: ${{ github.workspace }}/output
- name: Determine Release Channel
id: channel
uses: actions/github-script@v6
env:
FLAVOR: ${{ inputs.build-flavor }}
with:
result-encoding: string
script: |
const ref = process.env.FLAVOR || 'edge';
switch (ref) {
case 'beta': return '11ef2676-fc31-41b5-897b-fd21273d87ed';
case 'stable': return '6634f0b1-323c-4a2f-bd0b-8f1f388673a9';
case 'edge':
default: return '325e197e-55f4-449a-b2bb-6831fe47bf2a';
}
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2.0
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ steps.channel.outputs.result }}
with:
publish-dir: ${{ github.workspace}}/output
production-deploy: true
deploy-message: ${{ inputs.build-title }}