Tests #119
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
# This workflow will do an install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Tests | |
on: | |
workflow_run: | |
workflows: [Update Sets] | |
types: [completed] | |
workflow_dispatch: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: Zarel/setup-node@patch-1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm install | |
- run: npm run test | |
env: | |
CI: true | |
publish: | |
if: ${{ github.repository == 'smogon/damage-calc' && (github.event_name == 'push' || github.event.workflow_run.conclusion == 'success') }} | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- uses: actions/checkout@v2 | |
- run: npm install | |
- name: Build | |
run: node build | |
- name: Upload artifact for GitHub Pages | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload entire repository | |
path: 'dist' | |
- uses: actions/configure-pages@v1 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |