Update build.yml #2
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, Test & Publish | |
on: | |
push: | |
paths: | |
- 'src/**' | |
- '.github/workflows/**' | |
branches: [ main ] | |
pull_request: | |
paths: | |
- 'src/**' | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ./src/word-plugin | |
strategy: | |
matrix: | |
node-version: ['20.x'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Clean slate | |
working-directory: ${{env.working-directory}} | |
run: npm ci | |
- name: Build | |
working-directory: ${{env.working-directory}} | |
run: npm run build | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
# Artifact name | |
name: package | |
# Directory containing files to upload | |
path: ${{env.working-directory}}/dist/ | |
# Days before delete | |
retention-days: 1 |