Skip to content

🛠️ Only building on push. (b18774f9b2922f083c890093afe96583f32e66c5) #35

🛠️ Only building on push. (b18774f9b2922f083c890093afe96583f32e66c5)

🛠️ Only building on push. (b18774f9b2922f083c890093afe96583f32e66c5) #35

Workflow file for this run

name: Big Bang CI/CD Pipeline
run-name: "🛠️ ${{ github.event.head_commit.message }} (${{ github.sha }})"
on:
push:
branches:
- big-bang-demo
jobs:
build:
name: 🛠️ Build Frontend Artifact
needs:
- audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node 16
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Cache Node Modules
uses: actions/cache@v3
with:
path: frontend/node_modules
key: fe-node-${{ hashFiles('frontend/package-lock.json') }}
- name: Install deps
run: cd frontend && npm i
- name: Compile code
run: cd frontend && npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: frontend/build
audit:
name: 🛡️ Audit Frontend Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check for vulnerabilities
run: cd frontend && npm audit --production --audit-level=moderate
lint:
name: 🧼 Ensure Code Style
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Setup Node 16
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Cache Node Modules
uses: actions/cache@v3
with:
path: frontend/node_modules
key: fe-node-${{ hashFiles('frontend/package-lock.json') }}
- name: Install deps
run: cd frontend && npm i
- name: 😂 Lint code
run: cd frontend && npm run lint
test:
name: 🧪 Run Unit Tests
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node 16
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Cache Node Modules
uses: actions/cache@v3
with:
path: frontend/node_modules
key: fe-node-${{ hashFiles('frontend/package-lock.json') }}
- name: Install deps
run: cd frontend && npm i
- name: Run the unit tests
run: cd frontend && npm run test-ci
static-analysis:
name: 🔬 Run Static Code Analysis
needs: [build]
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
config-file: ./.github/codeql/codeql.config.yml
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Cache Node Modules
id: cache
uses: actions/cache@v3
with:
path: frontend/node_modules
key: fe-node-${{ hashFiles('frontend/package-lock.json') }}
- name: Install Deps
run: cd frontend && npm i
- name: Build
run: cd frontend && npm run build
# - name: Perform Analysis
# uses: github/codeql-action/analyze@v2
deploy:
name: 🚚 Deploy Frontend Artifact
runs-on: ubuntu-latest
needs:
- lint
- test
- static-analysis
#if: github.ref == 'refs/heads/main'
outputs:
page_url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
verify:
name: 🧪 Verify Successful Deployment
needs:
- deploy
runs-on: ubuntu-latest
if: success()
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run Frontend Smoke Test
run: |
export TEST_URL=${{needs.deploy.outputs.page_url}}
cd frontend/e2e
npm i
npm run smoke