This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Upload Artifact | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Step 2: Set up Node.js environment | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' # Specify the Node.js version | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: npm install | |
# Step 4: Run the build script | |
- name: Build the library | |
run: npm run build | |
# Step 5: Upload the ./dist folder as an artifact | |
- name: Upload dist as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-artifact | |
path: ./dist |