-
Notifications
You must be signed in to change notification settings - Fork 6
154 lines (121 loc) · 3.99 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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# DO NOT TOUCH THIS FILE
# Please speak to SudoVanilla (Korbs) if you have any issues.
# For Security check please contact Eveeifyeve Instead of sudovanilla.
name: Deploy Website
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
#Screenshot of website
# screenshot:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
# persist-credentials: true
# - name: Setup Node
# uses: actions/setup-node@v2
# with:
# node-version: '20' # or any version you prefer
# - name: Install dependencies
# run: npm install
# - name: Run server
# run: |
# npm run start &
# echo "NODE_PID=$!" >> $GITHUB_ENV
# sleep 6 # give the server some time to start
# - name: Install bun
# run: npm install -g bun
# - name: Take screenshot
# run: |
# npm run screenshot
# - name: Stop server
# run: kill ${{ env.NODE_PID }} # this will kill the process started by npm start
# - name: Commit and push if it changed
# run: |
# git config --global user.name 'Your Name'
# git config --global user.email '[email protected]'
# git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
# git checkout "${GITHUB_REF:11}"
# git commit -am "Automated Screenshot"
# git push
# ---------------------------------------------------------------------
# Linting - StyleLint + ESLint
Linting:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Run Stylelint
run: bun run lint:css
# ---------------------------------------------------------------------
# Formating - Prettier
Formating:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install > log.txt 2>&1 || exit 1
- name: Run bun fmt
run: bun fmt >> log.txt 2>&1
- name: Upload log
uses: actions/upload-artifact@v2
if: always()
with:
name: prettier(fmt)
path: log.txt
# ---------------------------------------------------------------------
# CommitLinting - Convertential Commits
CommitLint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install required dependencies
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install packages
run: |
bun install
- name: Print versions
run: |
bun --version
bunx commitlint --version
- name: Install commitlint
run: |
bun install conventional-changelog-conventionalcommits
bun install commitlint@latest
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: bunx commitlint --from HEAD~1 --to HEAD --verbose
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: bunx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
# ---------------------------------------------------------------------
# Building the website
Build:
runs-on: self-hosted
needs: [Linting, Formating, CommitLint]
steps:
- uses: actions/checkout@v3
# Install Dependenices
- run: bun install
# Build Website
- run: bun run build
# Add to NGINX
- run: mv dist/ teaclientmc/