Skip to content

Commit

Permalink
New github workflow triggered on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
yurushao committed Apr 1, 2024
1 parent f3a69a3 commit ec4df3a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/dapp.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Deploy Dapp to GitHub Pages

on:
pull_request:
branches: ["main"]

# Runs on pushes targeting the default branch
push:
branches: ["main"]
Expand Down Expand Up @@ -76,7 +73,6 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build dapp

on:
pull_request:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read

jobs:
# Build the dapp
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm run build

0 comments on commit ec4df3a

Please sign in to comment.