Skip to content

Commit

Permalink
Update CI/CD.
Browse files Browse the repository at this point in the history
  • Loading branch information
pwei1018 committed May 1, 2024
1 parent bfa920c commit f37ec05
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 95 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,23 @@ on:
- main
workflow_dispatch:
inputs:
environment:
description: "Environment"
target:
description: "Deploy To"
required: true
type: choice
options:
- dev
- test
- sandbox
- prod
tagname:
description: "Specify a previous version (git tag) to deploy"
required: false
default: ""

jobs:
bcregistry-ui-cd:
uses: bcgov/bcregistry-sre/.github/workflows/ui-cd.yaml@main
uses: bcgov/bcregistry-sre/.github/workflows/frontend-cd.yaml@main
with:
environment: ${{ inputs.environment }}
tagname: ${{ inputs.tagname }}
target: ${{ inputs.target }}
app_name: "bcregistry"
working_directory: "."
secrets:
APP_NAME: bcregistry
OP_CONNECT_URL: ${{ secrets.OP_CONNECT_URL }}
OP_CONNECT_TOKEN: ${{ secrets.OP_CONNECT_TOKEN }}
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
90 changes: 7 additions & 83 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,88 +2,12 @@ name: BCREGISTRY UI CI

on:
pull_request:
types: [assigned, synchronize]

defaults:
run:
shell: bash
workflow_dispatch:

jobs:
setup-job:
runs-on: ubuntu-20.04

if: github.repository == 'bcgov/bcregistry'

steps:
- uses: actions/checkout@v3
- run: "true"

linting:
needs: setup-job
runs-on: ubuntu-20.04

strategy:
matrix:
node-version: [16.14.2]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm ci
- name: Linting
run: |
npm run lint
testing-coverage:
needs: setup-job
runs-on: ubuntu-20.04

strategy:
matrix:
node-version: [16.14.2]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm ci
- name: Test with Jest
id: test
run: |
npm run test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: codecov-bcregistry
fail_ci_if_error: true

build-check:
needs: setup-job
runs-on: ubuntu-20.04

strategy:
matrix:
node-version: [16.14.2]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm ci
- name: build
id: build
run: |
npm run build
bcregistry-ui-ci:
uses: pwei1018/bcregistry-sre/.github/workflows/frontend-ci.yaml@main
with:
app_name: "bcregistry"
working_directory: "."
codecov_flag: ""
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"dev": "nuxt",
"build": "nuxt generate",
"build-check": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
Expand Down

0 comments on commit f37ec05

Please sign in to comment.