forked from kprakhar27/InboxAI
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (65 loc) · 2.17 KB
/
Copy pathui-deploy.yml
File metadata and controls
71 lines (65 loc) · 2.17 KB
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
name: Deploy to GitHub Pages
on:
push:
branches: ['main']
paths: ['frontend/**']
jobs:
deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages -d dist -u "github-actions-bot <support+actions@github.com>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
notify:
runs-on: ubuntu-latest
if: always()
needs: deploy
env:
SMTP__SMTP_HOST: smtp.gmail.com
SMTP__SMTP_PORT: 465
SMTP__SMTP_USER: pc612001@gmail.com
SMTP__SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
SMTP__SMTP_MAIL_FROM: pc612001@gmail.com
ALERT_EMAIL: choudhari.pra@northeastern.edu
steps:
- name: Notify Success
if: success()
uses: dawidd6/action-send-mail@v4
with:
server_address: ${{ env.SMTP__SMTP_HOST }}
server_port: ${{ env.SMTP__SMTP_PORT }}
username: ${{ env.SMTP__SMTP_USER }}
password: ${{ env.SMTP__SMTP_PASSWORD }}
subject: "✅ Cloud Run Deployment Successful"
to: ${{ env.ALERT_EMAIL }}
from: ${{ env.SMTP__SMTP_MAIL_FROM }}
secure: true
body: "Frontend has been successfully deployed to GitHub Pages."
- name: Notify Failure
if: failure()
uses: dawidd6/action-send-mail@v4
with:
server_address: ${{ env.SMTP__SMTP_HOST }}
server_port: ${{ env.SMTP__SMTP_PORT }}
username: ${{ env.SMTP__SMTP_USER }}
password: ${{ env.SMTP__SMTP_PASSWORD }}
subject: "❌ Cloud Run Deployment Failed"
to: ${{ env.ALERT_EMAIL }}
from: ${{ env.SMTP__SMTP_MAIL_FROM }}
secure: true
body: "Frontend deployment failed. Please check GitHub Actions logs for more info."