-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (43 loc) · 1.57 KB
/
deploy.yml
File metadata and controls
50 lines (43 loc) · 1.57 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
name: 📝 Code Notes Deployment 🚀
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch origin main
- name: 🧮 Get Notes Statistics
id: get_notes_stats
run: yarn stats
- name: 🚀 Deploy
if: ${{ !env.ACT }}
uses: enriikke/gatsby-gh-pages-action@v2
with:
access-token: ${{ secrets.ACCESS_TOKEN }}
deploy-branch: gh-pages
gatsby-args: --prefix-paths
- name: 💬 Send message to Slack
if: ${{ !env.ACT && always() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://raw.githubusercontent.com/lkcozy/code-notes/master/assets/logo.png
SLACK_MESSAGE: ${{job.status}} - ${{steps.get_notes_stats.outputs.summary}}.
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: ✉️ Send mail
if: ${{ !env.ACT && always() }}
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
subject: ${{ job.status }} - Total ${{steps.get_notes_stats.outputs.total}} notes ${{ github.job }} job of ${{ github.repository }}
body: ${{steps.get_notes_stats.outputs.summary}}. Online Code Notes:https://lkcozy.github.io/code-notes/
to: lkklcozy@gmail.com
from: lkcozy