Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
linxiaoxin committed Jul 11, 2024
2 parents 71e56d0 + da02cc9 commit 07824a4
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 16 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ env:
AWS_REGION: ap-southeast-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
PROD_URL: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

jobs:

build:

runs-on: ubuntu-latest
Expand All @@ -27,7 +28,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -69,7 +70,7 @@ jobs:
name: quemistry-web-client
path: dist/
overwrite: true

audit:
needs: build
name: Audit Packages
Expand All @@ -80,7 +81,7 @@ jobs:
run: npm audit --audit-level moderate
env:
CI: true

deploy_to_s3:
needs: [build, audit]
runs-on: ubuntu-latest
Expand All @@ -99,4 +100,30 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'ap-southeast-1'
AWS_DEFAULT_REGION: 'ap-southeast-1'

# Invalidate Cloudfront (this action)
- name: invalidate
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
PATHS: '/*'
AWS_REGION: ${{ secrets.S3_BUCKET_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

zap_scan:
permissions: write-all
needs: deploy_to_s3
runs-on: ubuntu-latest
name: Zap Scan
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: main

- name: ZAP Scan
uses: zaproxy/action-full-scan@v0.10.0
with:
target: ${{env.PROD_URL}}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
dist/
dist/
.idea
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"lint": "next lint"
},
"dependencies": {
"@types/node": "20.12.12",
"@types/node": "20.13.0",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"chart.js": "4.2.1",
"next": "^14.2.3",
"primeflex": "^3.3.1",
"primeicons": "^6.0.1",
"primereact": "^10.6.5",
"primereact": "^10.6.6",
"quill": "^2.0.2",
"react": "18.3.1",
"react-cookie": "^7.1.4",
Expand Down

0 comments on commit 07824a4

Please sign in to comment.