Skip to content

Commit

Permalink
Merge pull request #4 from cds-snc/fix/fix_up_ci_action
Browse files Browse the repository at this point in the history
Fixing up ci action to actually work
  • Loading branch information
sylviamclaughlin authored Feb 8, 2024
2 parents 5bb22ca + 97a4a4e commit 472d46a
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Node CI
on:
push:
branches-ignore:
branches:
- main
pull_request:
branches-ignore:
branches:
- main

jobs:
lint:
name: Lint
Expand All @@ -14,30 +15,45 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14

- name: Cache node modules
uses: c-hive/gha-npm-cache@v1

- name: Install dependencies
run: npm ci

- name: Run lint command
run: npm run lint

build:
name: Build
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14

- name: Cache node modules
uses: c-hive/gha-npm-cache@v1

- name: Install dependencies
run: npm ci
- name: Run build command
run: npm run build

- name: Test dist has been updated
env:
DIST_OLD: dist-old
DIST: dist
run: |
cp -r $DIST $DIST_OLD
npm run build
diff -r $DIST $DIST_OLD || exit 1

0 comments on commit 472d46a

Please sign in to comment.