-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (43 loc) · 1.28 KB
/
main.yml
File metadata and controls
54 lines (43 loc) · 1.28 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
name: Build and Deploy
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Remove existing prod branch (if exists)
run: |
git fetch --prune
git show-ref --verify --quiet refs/heads/prod && git branch -D prod || true
git push origin --delete prod || true
- name: Create prod branch from main
run: |
git checkout -b prod
git push -u origin prod
- name: Use Node.js 20.x
uses: actions/setup-node@v2
with:
node-version: 20.x
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies with pnpm
run: pnpm install
- name: Build with pnpm
run: pnpm build
- name: Modify .gitignore
run: |
rm .gitignore || true
echo ".env" > .gitignore
echo "node_modules" >> .gitignore
rm -rf src
- name: Push changes to prod branch
run: |
git config --global user.email "contact@jeremysoler.com"
git config --global user.name "Garder500[Bot]"
git add .
git commit -m "Update everythings"
git push origin prod --force