-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (37 loc) · 1.29 KB
/
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
42
43
44
45
46
47
name: Build and Push Artifact
# Trigger the workflow on push to the `main` branch
on:
push:
branches:
- master
# Optionally trigger manually via `workflow_dispatch`
workflow_dispatch:
jobs:
# Define a job named `build` that runs on the latest Ubuntu runner
build:
runs-on: ubuntu-latest
# Define the steps that will be executed in this job
steps:
# Step 1: Checkout the repository code
- name: Checkout repository
uses: actions/checkout@v2
# Step 2: Set up Node.js (using version 16 as an example)
# - name: Set up Node.js
# uses: actions/setup-node@v3
# with:
# node-version: '16'
# Step 3: Install dependencies using npm
# - name: Install dependencies
# run: yarn install
# Step 4: Run tests (assuming you have tests defined in your project)
# - name: Run tests
# run: npm test
# Step 5: Build the application (e.g., for production or deployment)
# - name: Build application
# run: npm run build
# Optional: Upload build artifacts (if any) for later use
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: build-artifact
path: ./public/ # Example path to a build directory (adjust as needed)