Skip to content

Commit 6192e30

Browse files
authored
👷 Add CI Deployment Script for GitHub Pages (#53)
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
1 parent 761531b commit 6192e30

File tree

21 files changed

+217
-93
lines changed

21 files changed

+217
-93
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@ jobs:
9595
run: |
9696
awesome_bot ./*.md src/*.sol test/**/*.sol test/public/**/*.sol interface/*.md interface/public/*.css interface/src/**/*.css interface/src/**/*.tsx interface/src/**/*.ts interface/src/components/**/*.tsx \
9797
--allow-dupe --request-delay 0.4 \
98-
--white-list "https://github.com/pcaversaccio/createx/issues/new?assignees=pcaversaccio&labels=new+deployment+%E2%9E%95&projects=&template=deployment_request.yml&title=%5BNew-Deployment-Request%5D%3A+",https://twitter.com/PaulRBerg/status/1682346315806539776,https://www.createx.rocks,https://foundry.paradigm.xyz,https://github.com/pcaversaccio/createx.git
98+
--white-list "https://github.com/pcaversaccio/createx/issues/new?assignees=pcaversaccio&labels=new+deployment+%E2%9E%95&projects=&template=deployment_request.yml&title=%5BNew-Deployment-Request%5D%3A+",https://twitter.com/PaulRBerg/status/1682346315806539776,https://foundry.paradigm.xyz,https://github.com/pcaversaccio/createx.git

.github/workflows/deploy.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: 🚀 UI deployment
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
workflow_dispatch:
7+
8+
# Allows only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
9+
# However, we do not cancel in-progress runs as we want to allow these production deployments to complete.
10+
concurrency:
11+
group: "pages"
12+
cancel-in-progress: false
13+
14+
jobs:
15+
build:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os:
20+
- ubuntu-latest
21+
node_version:
22+
- 20
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Install pnpm
29+
uses: pnpm/action-setup@v2
30+
with:
31+
version: latest
32+
run_install: false
33+
34+
- name: Get pnpm cache directory path
35+
id: pnpm-cache-dir-path
36+
run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
37+
38+
- name: Restore pnpm cache
39+
uses: actions/cache@v3
40+
id: pnpm-cache
41+
with:
42+
path: |
43+
${{ steps.pnpm-cache-dir-path.outputs.dir }}
44+
${{ github.workspace }}/interface/.next/cache
45+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('interface/**/*.js', 'interface/**/*.jsx', 'interface/**/*.ts', 'interface/**/*.tsx') }}
46+
restore-keys: |
47+
${{ runner.os }}-pnpm-store-
48+
49+
- name: Use Node.js ${{ matrix.node_version }}
50+
uses: actions/setup-node@v4
51+
with:
52+
node-version: ${{ matrix.node_version }}
53+
54+
- name: Install pnpm project with a clean slate
55+
run: pnpm install --prefer-offline --frozen-lockfile
56+
57+
- name: Build with Next.js
58+
run: pnpm build:interface
59+
60+
- name: Upload artifacts
61+
uses: actions/upload-pages-artifact@v2
62+
with:
63+
path: "interface/dist"
64+
65+
deploy:
66+
runs-on: ${{ matrix.os }}
67+
needs: build
68+
environment:
69+
name: github-pages
70+
url: ${{ steps.deployment.outputs.page_url }}
71+
permissions:
72+
pages: write
73+
id-token: write
74+
strategy:
75+
matrix:
76+
os:
77+
- ubuntu-latest
78+
79+
steps:
80+
- name: Deploy to GitHub Pages
81+
id: deployment
82+
uses: actions/deploy-pages@v3

.github/workflows/test-createx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
node_version:
2020
- 20
2121
go_version:
22-
- 1.21.3
22+
- 1.21.5
2323

2424
steps:
2525
- name: Checkout

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[![🕵️‍♂️ Test CreateX](https://github.com/pcaversaccio/createx/actions/workflows/test-createx.yml/badge.svg)](https://github.com/pcaversaccio/createx/actions/workflows/test-createx.yml)
44
[![Test Coverage](https://img.shields.io/badge/Coverage-100%25-green)](#test-coverage)
5+
[![👮‍♂️ Sanity checks](https://github.com/pcaversaccio/createx/actions/workflows/checks.yml/badge.svg)](https://github.com/pcaversaccio/createx/actions/workflows/checks.yml)
6+
[![🚀 UI deployment](https://github.com/pcaversaccio/createx/actions/workflows/deploy.yml/badge.svg)](https://github.com/pcaversaccio/createx/actions/workflows/deploy.yml)
57
[![License: AGPL-3.0-only](https://img.shields.io/badge/License-AGPL--3.0--only-blue)](https://www.gnu.org/licenses/agpl-3.0)
68

79
<img src=https://github-production-user-asset-6210df.s3.amazonaws.com/25297591/272914952-38a5989c-0113-427d-9158-47646971b7d8.png width="1050"/>
@@ -2158,7 +2160,7 @@ To verify a deployed [`CreateX`](./src/CreateX.sol) contract on a block explorer
21582160
## [`CreateX`](./src/CreateX.sol) Deployments
21592161

21602162
> [!TIP]
2161-
> The complete list with additional chain information per deployment can be retrieved via [createx.rocks](https://www.createx.rocks).
2163+
> The complete list with additional chain information per deployment can be retrieved via [createx.rocks](https://createx.rocks).
21622164
21632165
- EVM-Based Production Networks:
21642166
- Ethereum: [`0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed`](https://etherscan.io/address/0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed)

hardhat.config.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,6 @@ const config: HardhatUserConfig = {
126126
url: vars.get("OPTIMISM_MAINNET_URL", "https://mainnet.optimism.io"),
127127
accounts,
128128
},
129-
arbitrumTestnet: {
130-
chainId: 421613,
131-
url: vars.get(
132-
"ARBITRUM_TESTNET_URL",
133-
"https://goerli-rollup.arbitrum.io/rpc",
134-
),
135-
accounts,
136-
},
137129
arbitrumSepolia: {
138130
chainId: 421614,
139131
url: vars.get(
@@ -484,10 +476,9 @@ const config: HardhatUserConfig = {
484476
polygonZkEVM: vars.get("POLYGON_ZKEVM_API_KEY", ""),
485477
polygonMumbai: vars.get("POLYGON_API_KEY", ""),
486478
polygonZkEVMTestnet: vars.get("POLYGON_ZKEVM_API_KEY", ""),
487-
// For Arbitrum testnets & mainnets
479+
// For Arbitrum testnet & mainnets
488480
arbitrumOne: vars.get("ARBITRUM_API_KEY", ""),
489481
arbitrumNova: vars.get("ARBITRUM_API_KEY", ""),
490-
arbitrumGoerli: vars.get("ARBITRUM_API_KEY", ""),
491482
arbitrumSepolia: vars.get("ARBITRUM_API_KEY", ""),
492483
// For Avalanche testnet & mainnet
493484
avalanche: vars.get("AVALANCHE_API_KEY", ""),

interface/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
.next
33
next-env.d.ts
4+
dist

interface/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ yarn-error.log*
4949
# Next.js
5050
.next
5151
next-env.d.ts
52+
dist

interface/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
.next
33
next-env.d.ts
4+
dist

interface/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [`CreateX`](../src/CreateX.sol) User Interface
22

3-
[Next.js](https://nextjs.org)-based user interface for [createx.rocks](https://www.createx.rocks).
3+
[Next.js](https://nextjs.org)-based user interface for [createx.rocks](https://createx.rocks).
44

55
## 🙏🏼 Acknowledgement
66

0 commit comments

Comments
 (0)