This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (49 loc) · 1.94 KB
/
deploy.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
name: CD
on:
workflow_dispatch:
permissions: read-all
jobs:
dev_deploy:
name: Build and Deploy to Production
if: ${{ github.repository == 'sws2apps/lmm-oa-sws' && github.ref == 'refs/heads/main' }}
environment:
name: Prod.env
url: https://lmm-oa-sws.web.app
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout for release preparation
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: main
persist-credentials: false
- name: Use Node.js current version
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version: current
- name: Install package dependencies
run: npm ci
- name: Run Semantic Release to version and build App
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
VITE_FINGERPRINT_API_CLIENT_KEY: ${{ secrets.VITE_FINGERPRINT_API_CLIENT_KEY }}
VITE_FIREBASE_APIKEY: ${{ secrets.VITE_FIREBASE_APIKEY }}
VITE_FIREBASE_AUTHDOMAIN: ${{ secrets.VITE_FIREBASE_AUTHDOMAIN }}
VITE_FIREBASE_PROJECTID: ${{ secrets.VITE_FIREBASE_PROJECTID }}
VITE_FIREBASE_APPID: ${{ secrets.VITE_FIREBASE_APPID }}
VITE_FIREBASE_MEASUREMENTID: ${{ secrets.VITE_FIREBASE_MEASUREMENTID }}
- name: Check if new version has been generated
id: check_build
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b
with:
files: 'dist'
- name: Deploy to Firebase
if: ${{ steps.check_build.outputs.files_exists == 'true' }}
uses: sws2apps/firebase-deployment@0c7064193015dbff8eefbf511fcc2221d82c270b
with:
workloadIdentityProvider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
serviceAccount: ${{ secrets.SERVICE_ACCOUNT }}
project: lmm-oa-sws