Skip to content

Commit

Permalink
Merge pull request #4 from HydrologicEngineeringCenter/feature/cicd-i…
Browse files Browse the repository at this point in the history
…mprovements

CI/CD Overhaul
  • Loading branch information
jbkolze authored Nov 12, 2024
2 parents b906373 + 1d6467f commit ea160f1
Show file tree
Hide file tree
Showing 1,369 changed files with 959 additions and 98,164 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build, Test, and Publish

on:
workflow_dispatch:

permissions:
pages: write
id-token: write

jobs:
build-test-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Generate and build API
run: npm run buildApi

- name: Install dependencies in tests directory
working-directory: tests
run: npm ci

- name: Link cwmjs dependency from src to tests
run: npm run link

- name: Run tests
working-directory: tests
run: npm run test --ci

- name: Publish to npm
if: success()
working-directory: cwmsjs
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Build docs
if: success()
run: npm run buildDocs

- name: Upload docs artifact
if: success()
uses: actions/upload-pages-artifact@v3
with:
path: ./cwmsjs/docs

deploy-docs:
needs: build-test-publish
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
48 changes: 0 additions & 48 deletions .github/workflows/test-docs-endpoints.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
wwwroot/*.js
node_modules
typings
cwmsjs/
cwms-swagger*.json
Loading

0 comments on commit ea160f1

Please sign in to comment.