generated from hellotham/hello-astro
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (32 loc) · 993 Bytes
/
build.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
name: Test Netlify Build
on:
# Trigger the workflow every time you push to any branch
push:
# Allows you to run this workflow manually from the Actions tab on GitHub.
branches:
- '*'
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout your repository using git
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: Extract build command from netlify.toml
id: extract-build-command
run: |
BUILD_COMMAND=$(sed -n '/^\[build\]/,/^\[.*\]/ s/^\s*command\s*=\s*"\(.*\)"/\1/p' netlify.toml)
echo "BUILD_COMMAND=$BUILD_COMMAND" >> $GITHUB_OUTPUT
- name: Run build command from netlify.toml
run: ${{ steps.extract-build-command.outputs.BUILD_COMMAND }}