fix deps in injective #31
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: Build Next.js examples | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
fail-fast: true | |
matrix: | |
include: | |
- name: authz | |
folder: examples | |
- name: ibc-asset-list | |
folder: examples | |
- name: injective | |
folder: examples | |
- name: injective-vue | |
folder: examples | |
- name: stake-tokens | |
folder: examples | |
- name: vote-proposal | |
folder: examples | |
- name: chain-template | |
folder: templates | |
- name: connect-chain | |
folder: templates | |
- name: connect-multi-chain | |
folder: templates | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set template_path Environment Variable | |
run: | | |
echo "template_path=${{ matrix.folder }}" >> $GITHUB_ENV | |
echo "ci_template_path=dest" >> $GITHUB_ENV | |
- name: Log | |
run: | | |
echo "Using template_path: $template_path" | |
echo "Using ci_template_path: $ci_template_path" | |
- name: Clone example | |
run: | | |
echo "Cloning example: ./$template_path/${{ matrix.name }}/ into ${{ github.workspace }}/$ci_template_path/${{ matrix.name }}" | |
mkdir -p ${{ github.workspace }}/$ci_template_path/${{ matrix.name }} | |
cp -r ./$template_path/${{ matrix.name }}/ ${{ github.workspace }}/$ci_template_path/ | |
cd ${{ github.workspace }}/$ci_template_path/${{ matrix.name }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Set up Yarn | |
uses: threeal/setup-yarn-action@v2.0.0 | |
- name: Get last git commit hash | |
run: | | |
echo "DIFF_HASH=$(git log -1 --pretty=format:%H)" >> $GITHUB_ENV | |
- name: Cache NextJS | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ github.workspace }}/.next/cache | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ env.DIFF_HASH }} | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}- | |
- name: Build example project | |
run: | | |
echo "Building example: ${{ matrix.name }} in directory ${{ github.workspace }}/$ci_template_path/${{ matrix.name }}" | |
cd ${{ github.workspace }}/$ci_template_path/${{ matrix.name }} | |
ls -la | |
yarn install | |
yarn build |