-
-
Notifications
You must be signed in to change notification settings - Fork 11
45 lines (37 loc) · 1.08 KB
/
ci.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
name: CI
on:
push:
branches:
- main # or the branch you want to trigger the workflow on
pull_request:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Specify the Node.js version you want to use
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test
- name: Build project
run: npm run build
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: ./dist
production-branch: main
deploy-message: ${{ github.event.head_commit.message }}
enable-pull-request-comment: true
enable-commit-comment: true
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1