Update dotnet and node versions (#173) #458
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Client | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- client/** | |
- .github/** | |
- CNAME | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: ./client | |
jobs: | |
build-client: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: npm | |
cache-dependency-path: client/package-lock.json | |
node-version-file: client/package.json | |
- name: Check CLI tools | |
run: | | |
for tool in node npm; do | |
if ! command -v $tool &> /dev/null; then | |
echo "${tool} is not installed" | |
exit 1 | |
fi | |
${tool} --version | |
done | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Build | |
run: | | |
npm run build --if-present | |
cp ./dist/index.html ./dist/404.html | |
- name: Unit tests | |
run: | | |
npm run test:unit | |
- name: E2E tests | |
run: | | |
npm run test:e2e | |
- name: Deploy | |
if: ${{ github.ref == 'refs/heads/main' }} | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: client/dist | |
allow_empty_commit: false | |
keep_files: false | |
force_orphan: true | |
cname: edu.exokomodo.com | |
- name: Send status to Discord | |
uses: nebularg/actions-discord-webhook@v1 | |
if: always() | |
with: | |
webhook_url: ${{ secrets.DISCORD_CI_WEBHOOK }} | |
status: ${{ job.status }} |