-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(snaefell-ui): ui deployment (#17227)
Co-authored-by: Daniel Wang <99078276+dantaik@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Snaefell UI | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
build: | ||
runs-on: [taiko-runner] | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/cancel-workflow-action@0.12.1 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install pnpm dependencies | ||
uses: ./.github/actions/install-pnpm-dependencies | ||
# This step is needed because the .env file is not committed to the repository | ||
# and the Svelte check complains about not finding the exports from $env/static/public, | ||
# which will be generated based on the .env file when running `svelte-kit sync` | ||
- name: Copy .env.example to .env | ||
working-directory: ./packages/snaefell-ui | ||
run: cp .env.example .env | ||
|
||
- name: Frontend build | ||
working-directory: ./packages/snaefell-ui | ||
run: pnpm build | ||
|
||
- name: Svelte check | ||
working-directory: ./packages/snaefell-ui | ||
run: pnpm check | ||
|
||
- name: Check formatting | ||
working-directory: ./packages/snaefell-ui | ||
run: pnpm lint | ||
|
||
- name: Unit tests | ||
env: | ||
SKIP_ENV_VALIDATION: "true" | ||
working-directory: ./packages/snaefell-ui | ||
run: pnpm test:unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Snaefell UI CI/CD | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- release-please-* | ||
paths: | ||
- "packages/snaefell-ui/**" | ||
pull_request: | ||
paths: | ||
- "packages/snaefell-ui/**" | ||
|
||
jobs: | ||
build-and-test: | ||
uses: ./.github/workflows/snaefell-ui--ci.yml | ||
|
||
# Deployment name follow the pattern: deploy_<appname(snaefell-ui)>_<network(devnet|hekla|mainnet)>_<environment(preview|production)> | ||
deploy_snaefell-ui_mainnet_preview: | ||
if: ${{ github.ref_name != 'main' }} | ||
needs: build-and-test | ||
uses: ./.github/workflows/repo--vercel-deploy.yml | ||
with: | ||
environment: "preview" | ||
flags: "" | ||
secrets: | ||
vercel_project_id: ${{ secrets.VERCEL_PROJECT_ID_TAIKOON_UI_MAINNET }} | ||
vercel_org_id: ${{ secrets.VERCEL_ORG_ID }} | ||
vercel_token: ${{ secrets.VERCEL_TOKEN }} | ||
|
||
deploy_snaefell-ui_mainnet_production: | ||
if: ${{ github.ref_name == 'main' && contains(github.ref, 'refs/tags/snaefell-ui-') }} | ||
needs: build-and-test | ||
uses: ./.github/workflows/repo--vercel-deploy.yml | ||
with: | ||
environment: "production" | ||
flags: "--prod" | ||
secrets: | ||
vercel_project_id: ${{ secrets.VERCEL_PROJECT_ID_TAIKOON_UI_MAINNET }} | ||
vercel_org_id: ${{ secrets.VERCEL_ORG_ID }} | ||
vercel_token: ${{ secrets.VERCEL_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BAR=FOO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters