-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (70 loc) · 2.17 KB
/
Copy pathdeploy.yml
File metadata and controls
78 lines (70 loc) · 2.17 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
name: Deploy to Production
on:
workflow_dispatch:
inputs:
tag:
description: 'Existing tag to deploy (e.g. v2.9.0). Ignored when ref is set.'
required: false
type: string
ref:
description: 'Git ref to deploy (e.g. refs/heads/main or a8185be). Overrides tag.'
required: false
type: string
workflow_call:
inputs:
ref:
description: 'Git ref to build and deploy'
required: true
type: string
deploy_message:
description: 'Netlify deploy message'
required: false
type: string
default: ''
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Resolve checkout ref
id: checkout_ref
run: |
set -euo pipefail
if [ -n "${{ inputs.ref }}" ]; then
REF="${{ inputs.ref }}"
elif [ -n "${{ github.event.inputs.ref }}" ]; then
REF="${{ github.event.inputs.ref }}"
elif [ -n "${{ github.event.inputs.tag }}" ]; then
REF="${{ github.event.inputs.tag }}"
else
REF="${{ github.ref }}"
fi
echo "ref=${REF}" >> "$GITHUB_OUTPUT"
echo "Checkout ref: ${REF}"
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ steps.checkout_ref.outputs.ref }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Build
run: bun run build
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v3.0
with:
publish-dir: './dist'
production-deploy: true
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: ${{ inputs.deploy_message || format('Deploy {0}', steps.checkout_ref.outputs.ref) }}
enable-pull-request-comment: false
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}