Skip to content

Commit

Permalink
Merge pull request #17 from inkonchain/feat/build-ink-web-app-in-ci
Browse files Browse the repository at this point in the history
feat: build ink web app in ci
  • Loading branch information
ink-victor authored Feb 6, 2025
2 parents 93d9030 + 2e1f48e commit 2b68b21
Show file tree
Hide file tree
Showing 41 changed files with 1,387 additions and 1,051 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
.next
.git
.env*
!.env.production
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
55 changes: 55 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Environment
NEXT_PUBLIC_ENVIRONMENT=

# Sentry (Optional)
NEXT_PUBLIC_SENTRY_DSN=
SENTRY_AUTH_TOKEN=

# GTM
NEXT_PUBLIC_GTM_ID=

# Braze
BRAZE_INSTANCE_URL=
BRAZE_API_KEY=
BRAZE_GENERAL_WAITLIST_GROUP_ID=
BRAZE_DEVELOPERS_WAITLIST_GROUP_ID=

# OneTrust
NEXT_PUBLIC_ONE_TRUST_ID=

# Dune
NEXT_PUBLIC_DUNE_API_KEY=

# WalletConnect
NEXT_PUBLIC_WC_PROJECT_ID=

# hCaptcha
HCAPTCHA_SECRET=
NEXT_PUBLIC_HCAPTCHA_SITEKEY=

# Segment
NEXT_PUBLIC_SEGMENT_WRITE_KEY=

# Kraken Connect
NEXT_PUBLIC_KRAKEN_CLIENT_ID=
KRAKEN_CLIENT_SECRET=

# App Submission Bot
INK_APP_SUBMISSION_BOT_GITHUB_APP_ID=
INK_APP_SUBMISSION_BOT_GITHUB_PRIVATE_KEY=
INK_APP_SUBMISSION_BOT_GITHUB_INSTALLATION_ID=
INK_APP_SUBMISSION_TARGET_ORG=
INK_APP_SUBMISSION_TARGET_REPO=
INK_APP_SUBMISSION_TARGET_BRANCH=
INK_APP_SUBMISSION_SLACK_NOTIFICATION_CHANNEL=
INK_APP_SUBMISSION_SLACK_BOT_TOKEN=

# Smart Account Experiment
NEXT_PUBLIC_BUNDLER_URL=
NEXT_PUBLIC_PASSKEY_SERVER_URL=
NEXT_PUBLIC_PAYMASTER_URL=
NEXT_PUBLIC_GELATO_BRIDGE_URL=
NEXT_PUBLIC_FAUCET_API_URL=

# Testnet Faucet Experiment
MULTIPLIER_JWT_SECRET=
16 changes: 14 additions & 2 deletions .github/actions/base-setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@ runs:
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "pnpm"

- name: Install dependencies
- name: Add pnpm store path to env var
id: pnpm-cache
shell: bash
run: pnpm install --frozen-lockfile
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Restore Cache
uses: actions/cache@v4
with:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
**/node_modules
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
39 changes: 39 additions & 0 deletions .github/actions/image-build-push/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: image-build-push
description: Build and push a Docker image to GitHub Container Registry
inputs:
repository-name:
description: The name of the service to build and push
required: true
dockerfile-path:
description: The path to the Dockerfile for the service
required: true
github-token:
description: The GitHub token
required: true
docker-context:
description: The docker context path
required: true
outputs:
digest:
description: The digest of the built image
value: ${{ steps.build.outputs.digest }}
runs:
using: composite
steps:
- uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.github-token }}
- id: metadata
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: ghcr.io/inkonchain/${{ inputs.repository-name }}
- id: build
uses: docker/build-push-action@1a162644f9a7e87d8f4b053101d1d9a712edc18c
with:
context: ${{ inputs.docker-context }}
file: ${{ inputs.dockerfile-path }}
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
82 changes: 82 additions & 0 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: PR Checks
on: [pull_request]
jobs:
install_modules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Add pnpm store path to env var
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Cache node modules
uses: actions/cache@v4
with:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
**/node_modules
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
lint:
needs: install_modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/base-setup
name: Base Setup
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
- name: Generate dummy .env.production
run: ./scripts/generate-dummy-dotenv.sh
- name: Run linting
run: pnpm run lint

format:
needs: install_modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/base-setup
name: Base Setup
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
- name: Generate dummy .env.production
run: ./scripts/generate-dummy-dotenv.sh
- name: Run formatting
run: pnpm run format:check

build:
needs: install_modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/base-setup
name: Base Setup
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
- name: Generate dummy .env.production
run: ./scripts/generate-dummy-dotenv.sh
- name: Building app
run: pnpm run build
- name: Cache build
uses: actions/cache/save@v4
with:
path: .next
key: ${{ runner.os }}-build-store-${{ hashFiles('./src') }}
161 changes: 0 additions & 161 deletions .github/workflows/pull_request.yml

This file was deleted.

Loading

0 comments on commit 2b68b21

Please sign in to comment.