Skip to content

Commit ea2bbc5

Browse files
committed
ci: triggers deploying only when merged to main
1 parent 751311b commit ea2bbc5

File tree

2 files changed

+44
-13
lines changed

2 files changed

+44
-13
lines changed

.github/workflows/app.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ on:
1010
branches: [ main ]
1111

1212
jobs:
13-
lint_build_deploy:
14-
env:
15-
VITE_BASE: /fine-weather
16-
VITE_IMG_FETCH_BASE: https://bryanthe.pythonanywhere.com
17-
name: Lint and build and deploy
13+
lint:
14+
name: App Lint
1815
runs-on: ubuntu-latest
1916
defaults:
2017
run:
@@ -39,11 +36,3 @@ jobs:
3936

4037
- name: Lint
4138
run: pnpm run lint
42-
43-
- name: Build
44-
run: pnpm run build
45-
- name: Deploy
46-
uses: peaceiris/actions-gh-pages@v3
47-
with:
48-
github_token: ${{ secrets.GITHUB_TOKEN }}
49-
publish_dir: app/dist

.github/workflows/app_deploy.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: App Workflow
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build_deploy:
9+
env:
10+
VITE_BASE: /fine-weather
11+
VITE_IMG_FETCH_BASE: https://fineweather.pythonanywhere.com
12+
name: Build & Deploy
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
working-directory: app
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- uses: pnpm/action-setup@v2
22+
with:
23+
version: 8
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '20'
29+
cache: 'pnpm'
30+
cache-dependency-path: 'app/pnpm-lock.yaml'
31+
32+
- name: Install dependencies
33+
run: pnpm install
34+
35+
- name: Build
36+
run: pnpm run build
37+
38+
- name: Deploy
39+
uses: peaceiris/actions-gh-pages@v3
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
publish_dir: app/dist

0 commit comments

Comments
 (0)