Repository navigation
96 lines (81 loc) · 2.54 KB
/
Copy pathdeploy.yml
File metadata and controls
96 lines (81 loc) · 2.54 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
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
name: Lowkey Build Pipeline
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
outputs:
frontend: ${{ steps.filter.outputs.frontend }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Filter frontend changes
uses: dorny/paths-filter@f3ceefdc7ef57bc2d8560787d4b6c33e44044cec #v4
id: filter
with:
base: ${{ github.event.repository.default_branch || 'main' }}
filters: |
frontend:
- 'src/**'
- 'package.json'
- 'pnpm-lock.yaml'
- '.github/workflows/**'
lint:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.frontend == 'true' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v7
- name: Setup Environment
uses: ./.github/actions/setup-project/
- name: Run linting
run: pnpm run lint
test:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.frontend == 'true' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v7
- name: Setup Environment
uses: ./.github/actions/setup-project/
- name: Run tests
run: pnpm run test
build:
runs-on: ubuntu-latest
# This guarantees build ONLY runs if both lint and test succeed
needs: [changes, lint, test]
steps:
- name: Checkout Repository
uses: actions/checkout@v7
- name: Setup Environment
uses: ./.github/actions/setup-project/
- name: Build project
run: pnpm run build
- name: Upload build artifact
uses: actions/upload-artifact@v7
with:
name: app-build
path: dist/
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@2304451b4038577aa079e27936cc520845d25345 #v4
with:
publish-dir: './dist'
production-branch: master
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: false
enable-commit-comment: true
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_DISABLE_TELEMETRY: 1
timeout-minutes: 1