-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from 0LNetworkCommunity/feat/git-workflow
Add Workflow Files for API and Web-App Applications
- Loading branch information
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: CI-API | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- build-test | ||
pull_request: | ||
branches: | ||
- main | ||
- build-test | ||
|
||
jobs: | ||
build-api: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: api/node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('api/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install dependencies | ||
run: npm install | ||
working-directory: api | ||
|
||
- name: Build project | ||
run: npm run build | ||
working-directory: api | ||
|
||
# TODO: run tests for this app | ||
#- name: Run tests | ||
# run: npm test | ||
# working-directory: api |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CI-Web-App | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- build-test | ||
pull_request: | ||
branches: | ||
- main | ||
- build-test | ||
|
||
jobs: | ||
build-web-app: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Clean up node_modules and package-lock | ||
run: | | ||
rm -rf web-app/node_modules | ||
rm -f web-app/package-lock.json | ||
- name: Install dependencies | ||
run: npm install | ||
working-directory: web-app | ||
|
||
- name: Build project | ||
run: npm run build | ||
working-directory: web-app | ||
|
||
# TODO: run tests for this app | ||
#- name: Run tests | ||
# run: npm test | ||
# working-directory: web-app |