Skip to content

Commit

Permalink
infra: deploy to pages
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0ece committed Mar 31, 2024
1 parent 75624a8 commit 18d9120
Show file tree
Hide file tree
Showing 4 changed files with 2,101 additions and 1 deletion.
79 changes: 79 additions & 0 deletions .github/workflows/dapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Deploy Dapp to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

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

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

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

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

- name: Setup Pages
uses: actions/configure-pages@v5

- 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

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist/web

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ testem.log
Thumbs.db
.nx/cache
.anchor
anchor/target
!anchor/target/deploy/.gitignore
anchor/target/deploy
anchor/target/debug
anchor/target/release
anchor/target/sbf-solana-solana
anchor/target/.rustc_info.json
!anchor/target/idl/*.json
!anchor/target/types/*.ts
test-ledger
.yarn
Loading

0 comments on commit 18d9120

Please sign in to comment.