-
Notifications
You must be signed in to change notification settings - Fork 59
81 lines (75 loc) · 2.65 KB
/
deloy-beta.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
name: Build and Deploy (Beta)
on:
push:
branches:
- beta
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Setup Node.js 📦
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies 🔧
run: npm ci --include=dev
- name: Build code 🚚
run: npm run build
- name: Release front-end 🎢
run: |
sed -i -e 's/%COMMIT_SHA%/'"${GITHUB_SHA::7}-BETA"'/g' packages/ide/src/app/tab-start/tab-start.component.html
export DATE_NOW_FORMATTED=$(date +'%d/%m/%Y %I:%M:%S %p %Z')
sed -i -e 's*%DATE%*'"${DATE_NOW_FORMATTED}"'*g' packages/ide/src/app/tab-start/tab-start.component.html
sed -i -e 's/%SENTRY_RELEASE%/'"${GITHUB_SHA}"'/g' packages/ide/src/main.ts
npm run release
./packages/ide/cleanup-icons.sh
- name: Setup Firebase Hosting 🔥
env:
BETA_FIREBASE_PROJECT_ID: ${{ secrets.BETA_FIREBASE_PROJECT_ID }}
BETA_FIREBASE_HOSTING_SITE: ${{ vars.BETA_FIREBASE_HOSTING_SITE }}
run: |
jq -n --arg default "$BETA_FIREBASE_PROJECT_ID" '{ "projects": { "default": $default } }' > .firebaserc
cat <<EOF | tee firebase.json
{
"hosting": {
"site": "$BETA_FIREBASE_HOSTING_SITE",
"public": "packages/ide/dist/browser",
"ignore": ["firebase.json", "**/.*", "**/*.map", "**/*.map.*", "**/node_modules/**"],
"headers": [
{
"source": "/**",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=900, stale-while-revalidate=180"
}
]
},
{
"source":
"**/*.@(jpg|jpeg|gif|png|svg|webp|css|eot|otf|ttf|ttc|woff|woff2|font.css)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=604800"
}
]
}
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
EOF
- name: Deploy 🚀
uses: FirebaseExtended/action-hosting-deploy@v0
with:
firebaseServiceAccount: ${{ secrets.BETA_FIREBASE_SERVICE_ACCOUNT }}
projectId: ${{ vars.BETA_FIREBASE_PROJECT_ID }}
channelId: live