Skip to content

Commit

Permalink
Merge pull request #17 from NikhilSharma03/ci_cd_workflow
Browse files Browse the repository at this point in the history
ci: add `ci/cd` workflows
  • Loading branch information
NikhilSharma03 authored Dec 29, 2023
2 parents e4db2e0 + b13d6d3 commit b2c6a54
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
area/docs:
- 'README.md'
- 'assets/**/*'

area/ci:
- '.github/**/*'

area/contract:
- 'contract/**/*'

area/ui:
- 'ui/**/*'
23 changes: 23 additions & 0 deletions .github/workflows/build-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build UI Workflow

on:
pull_request:
branches:
- main

jobs:
build:
name: Build Job
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
run: npm ci

- name: Run build
run: npm run build
26 changes: 26 additions & 0 deletions .github/workflows/compile-and-test-contract.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Compile and Test Contract Workflow

on:
pull_request:
branches:
- main

jobs:
compile-and-test:
name: Compile and Test Job
runs-on: ubuntu-latest
defaults:
run:
working-directory: contract
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
run: npm ci

- name: Run Compile
run: npm run compile

- name: Run Test
run: npm run test
31 changes: 31 additions & 0 deletions .github/workflows/deploy-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy UI Workflow

on:
push:
branches:
- main

jobs:
deploy:
name: Deploy Job
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install and Build
run: |
npm ci
npm run build
env:
REACT_APP_CAMPAIGN_FACTORY_ADDRESS: ${{ secrets.CAMPAIGN_FACTORY_ADDRESS }}
REACT_APP_WEB3_PROVIDER: ${{ secrets.WEB3_PROVIDER_URL }}

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
15 changes: 15 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Pull Request Labeler

on:
pull_request:
types:
- opened

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
12 changes: 12 additions & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,17 @@
"stream-http": "^3.2.0",
"typescript": "^4.6.3",
"url": "^0.11.0"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

0 comments on commit b2c6a54

Please sign in to comment.