-
-
Notifications
You must be signed in to change notification settings - Fork 61
103 lines (90 loc) · 2.7 KB
/
build_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
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
97
98
99
100
101
102
103
name: "Build Web"
on:
workflow_call:
inputs:
build-flavor:
required: true
type: string
build-title:
required: true
type: string
secrets:
FIREBASE_TOKEN:
required: true
FIREBASE_SERVICE_WORKER:
required: true
jobs:
build-hosted:
name: Hosted
runs-on: ubuntu-latest
steps:
- name: Setup Environment
uses: JagandeepBrar/lunasea/.github/actions/prepare_for_build@master
with:
firebase-token: ${{ secrets.FIREBASE_TOKEN }}
firebase-service-worker: ${{ secrets.FIREBASE_SERVICE_WORKER }}
platform: web
- name: Build LunaSea
run: npm run build:web
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: web-hosted
path: ${{ github.workspace }}/build/web
build-archive:
name: Archive
runs-on: ubuntu-latest
steps:
- name: Setup Environment
uses: JagandeepBrar/lunasea/.github/actions/prepare_for_build@master
with:
platform: web
- name: Build LunaSea
run: npm run build:web
- name: Create Archive
uses: thedoctor0/zip-release@0.6.2
with:
type: zip
directory: ${{ github.workspace }}/build/web
filename: ../../output/lunasea-web-canvaskit.zip
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: web-archive
path: ${{ github.workspace }}/output
build-docker:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Setup Environment
uses: JagandeepBrar/lunasea/.github/actions/prepare_for_build@master
with:
platform: web
- name: Determine Tags
id: tags
uses: actions/github-script@v6
env:
BUILD_FLAVOR: ${{ inputs.build-flavor }}
BUILD_TITLE: ${{ inputs.build-title }}
with:
result-encoding: string
script: |
const tags = [];
tags.push(process.env.BUILD_FLAVOR);
tags.push(process.env.BUILD_TITLE);
if (process.env.BUILD_FLAVOR === 'stable') tags.push('latest');
return tags.map((tag) => `ghcr.io/jagandeepbrar/lunasea:${tag}`).join(',');
- name: Setup GitHub Package Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build & Push LunaSea
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
provenance: false
push: true
tags: ${{ steps.tags.outputs.result }}