Skip to content

Commit 9544a9f

Browse files
author
Ron de las Alas
committed
ci: add worflow
1 parent 2ad7b34 commit 9544a9f

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Scratch Parser CI-CD
2+
3+
on:
4+
pull_request: # Runs whenever a pull request is created or updated
5+
push: # Runs whenever a commit is pushed to the repository...
6+
branches: [master] # ...on any of these branches
7+
concurrency:
8+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: write
13+
pages: write
14+
issues: write
15+
pull-requests: write
16+
17+
jobs:
18+
build-and-deploy:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: wagoid/commitlint-github-action@v5
23+
- uses: actions/setup-node@v3
24+
with:
25+
cache: "npm"
26+
node-version-file: ".nvmrc"
27+
- name: Info
28+
run: |
29+
cat <<EOF
30+
Node version: $(node --version)
31+
NPM version: $(npm --version)
32+
GitHub ref: ${{ github.ref }}
33+
GitHub head ref: ${{ github.head_ref }}
34+
EOF
35+
- name: Install NPM Dependencies
36+
run: |
37+
npm ci
38+
- name: Lint
39+
run: npm run test:lint
40+
- name: Run All Tests
41+
run: npm run test
42+
- name: Semantic Release
43+
if: github.ref == 'master'
44+
env:
45+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: npx --no -- semantic-release

0 commit comments

Comments
 (0)