ci(deploy): install contracts submodule via yarn before SPA build (#15)
The p2pix-smart-contracts submodule ships a yarn v4 lockfile that bun cannot consume (UnsupportedYarnLockfileVersion). Install yarn in the build container, check out the submodule, and run yarn install via a new install:contracts package.json script. Then run wagmi:gen so src/blockchain/abi.ts exists before vite build. Co-authored-by: Arthur Abeilice <afa7789@gmail.com> Reviewed-on: https://git.p2pix.co/doiim/p2pix-front-end/pulls/15 Co-authored-by: arthur <abeilice@kosmos.org> Co-committed-by: arthur <abeilice@kosmos.org>
This commit is contained in:
40
.github/workflows/deploy.yml
vendored
40
.github/workflows/deploy.yml
vendored
@@ -15,23 +15,34 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: oven/bun:1-alpine
|
container: node:lts
|
||||||
steps:
|
steps:
|
||||||
- name: Install required tools
|
|
||||||
run: apk add --no-cache git
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Install bun
|
||||||
|
run: npm install -g bun
|
||||||
|
|
||||||
|
- name: Install submodule deps (yarn 4 via corepack)
|
||||||
|
run: corepack enable && yarn --cwd p2pix-smart-contracts install --immutable
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Generate contract ABIs
|
||||||
|
env:
|
||||||
|
ALCHEMY_API_KEY: dummy
|
||||||
|
run: bun run wagmi:gen
|
||||||
|
|
||||||
- name: Build SPA
|
- name: Build SPA
|
||||||
run: bun run build-only
|
run: bun run build-only
|
||||||
|
|
||||||
- name: Upload dist artifact
|
- name: Upload dist artifact
|
||||||
uses: actions/upload-artifact@v4
|
# v3 pinned: Gitea Actions does not implement the v4 cache API
|
||||||
|
# (the runner returns ECONNREFUSED on getCacheEntry).
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist/
|
path: dist/
|
||||||
@@ -40,9 +51,9 @@ jobs:
|
|||||||
deploy-rsync:
|
deploy-rsync:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: oven/bun:1-alpine
|
container: node:lts
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist/
|
path: dist/
|
||||||
@@ -59,11 +70,14 @@ jobs:
|
|||||||
deploy-ipfs:
|
deploy-ipfs:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: oven/bun:1-alpine
|
container: node:lts
|
||||||
outputs:
|
outputs:
|
||||||
cid: ${{ steps.ipfs.outputs.cid }}
|
cid: ${{ steps.ipfs.outputs.cid }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v4
|
- name: Install jq
|
||||||
|
run: apt-get update && apt-get install -y --no-install-recommends jq
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist/
|
path: dist/
|
||||||
@@ -82,16 +96,16 @@ jobs:
|
|||||||
deploy-pinata:
|
deploy-pinata:
|
||||||
needs: [deploy-ipfs, deploy-rsync]
|
needs: [deploy-ipfs, deploy-rsync]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: oven/bun:1-alpine
|
container: node:lts
|
||||||
steps:
|
steps:
|
||||||
- name: Install required tools
|
- name: Install jq
|
||||||
run: apk add --no-cache bash curl jq git
|
run: apt-get update && apt-get install -y --no-install-recommends jq
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
sparse-checkout: package.json
|
sparse-checkout: package.json
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist/
|
path: dist/
|
||||||
|
|||||||
Reference in New Issue
Block a user