-
Notifications
You must be signed in to change notification settings - Fork 5
62 lines (54 loc) · 1.7 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
name: Auto Deploy
on:
push:
branches:
- main
- dev
paths-ignore:
- '.github/**'
- '**/*.test.js'
- '**/*.test.ts'
pull_request:
branches-ignore:
- deploy
- deploy-beta
paths-ignore:
- '.github/**'
- '**/*.test.js'
- '**/*.test.ts'
workflow_dispatch:
branches-ignore:
- deploy
- deploy-beta
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build app
run: pnpm run build
- name: Get Deploy Target
id: target
run: echo "deploy=${{ ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && (github.ref_name == 'main' && 'deploy') || (github.ref_name == 'dev' && 'deploy-beta')) || '' }}" >> $GITHUB_OUTPUT
- name: Get update infos
if: ${{ steps.target.outputs.deploy }}
run: echo "$(git log --pretty=format:%s --grep='^feat(' --grep='^fix(' --grep='^feat:' --grep='^fix:' '${{ github.event.before }}...${{ github.event.after }}' | grep -v Merge)" > dist/CHANGELOG.md
- name: Deploy App
if: ${{ steps.target.outputs.deploy }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
branch: ${{ steps.target.outputs.deploy }}
- name: Purge ChangeLog
if: ${{ steps.target.outputs.deploy }}
run: curl -L https://purge.jsdelivr.net/gh/zvonimirsun/iszy-tools@deploy/CHANGELOG.md