web container #517
Workflow file for this run
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: Frontend | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
paths: | |
- '**.ts' | |
- '**.js' | |
- '**.json' | |
- '**.tsx' | |
- '.github/workflows/frontend.yml' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node: | |
- 18 | |
- 20 | |
env: | |
DFX_VERSION: 0.22.0 | |
SKIP_WASM: true | |
MOPS_VERSION: 0.2.0 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js ${{ matrix.node }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'npm' | |
cache-dependency-path: package-lock.json | |
- name: Install dfx | |
uses: dfinity/setup-dfx@main | |
with: | |
dfx-version: ${{ env.DFX_VERSION }} | |
- name: Install dfx dependencies | |
run: | | |
npm i -g ic-mops | |
dfx cache install | |
cd $(dfx cache show) | |
wget https://github.com/chenyan2002/mops-cli/releases/download/$MOPS_VERSION/mops-cli-linux64 | |
cp ./mops-cli-linux64 /usr/local/bin/mops-cli | |
chmod a+x /usr/local/bin/mops-cli | |
- name: Start dfx | |
run: | | |
dfx start --background | |
- name: Build frontend | |
run: | | |
dfx canister create --all | |
npm install | |
dfx build react_app | |
- name: Stop dfx | |
run: dfx stop |