Build and Publish Action #13
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 Publish Action | |
on: | |
workflow_run: | |
workflows: ["Validate Action", "Run unit tests", "ESLint Check"] | |
types: | |
- completed | |
jobs: | |
build: | |
if: > | |
github.event.workflow_run.conclusion == 'success' && | |
github.event.workflow_run.workflow_id == github.event.workflow_run.workflow_id && | |
github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
concurrency: build-and-publish | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "20" | |
- name: Install dependencies | |
run: npm install | |
- name: Build action with ncc | |
run: npm run build | |
- name: Publish to GitHub | |
uses: actions/upload-artifact@v4 | |
with: | |
name: action | |
path: dist |