-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (34 loc) · 1.11 KB
/
preview.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
name: Preview
on:
pull_request:
jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Get last commit message
id: get_commit_message
run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" >> $GITHUB_ENV
# https://github.com/marketplace/actions/netlify-actions
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './dist'
github-token: ${{ secrets.GITHUB_TOKEN }}
production-branch: main
deploy-message: ${{ env.COMMIT_MESSAGE }}
enable-pull-request-comment: false
netlify-config-path: ./netlify.toml
alias: preview-${{ github.event.number }}
github-deployment-environment: preview
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1