Use Node.js v20 in Github Action #3
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: Deploy Time Station Emulator | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup emsdk | |
uses: mymindstorm/setup-emsdk@v14 | |
run: emcc -v | |
- name: Build WebAssembly modules | |
run: npm run prebuild | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install npm dependencies | |
run: npm ci | |
- name: Setup Chrome | |
uses: browser-actions/setup-chrome@v1 | |
with: | |
chrome-version: stable | |
run: chrome --version | |
- name: Run Tests | |
run: npm run test | |
deploy: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup emsdk | |
uses: mymindstorm/setup-emsdk@v14 | |
run: emcc -v | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install npm dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build # Also builds WebAssembly modules. | |
- name: Deploy on Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: timestation | |
directory: dist |