-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add staging deploy * always deploy vercel preview * fix ci * try reusing * add setup-env * fix setup-env * try this way * try this way too * think this is it * skip postinstall * rename SKIP_YARN_POST_INSTALL * add vercel deploy comp action * version broadcasts * drop vercel.json * no need to build before vercel build * fix deploy, biome ignore stuff * typo * optimizzziiinnggg * fix * keep env YARN_ENABLE_HARDENED_MODE: 0 * fix deploy alias * fix links * fix url
- Loading branch information
Showing
12 changed files
with
497 additions
and
48 deletions.
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,40 @@ | ||
name: "Setup Environment" | ||
description: "Set up Node.js, install Foundry, and set up Bun. Runs Yarn install." | ||
inputs: | ||
install-foundry: | ||
description: "Whether to install Foundry." | ||
required: false | ||
default: "true" | ||
install-bun: | ||
description: "Whether to install Bun." | ||
required: false | ||
default: "true" | ||
install-node: | ||
description: "Whether to install Node.js." | ||
required: false | ||
default: "true" | ||
yarn-install: | ||
description: "Whether to run Yarn install." | ||
required: false | ||
default: "true" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Use Node.js | ||
if: ${{ inputs.install-node == 'true' }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .node-version | ||
cache: "yarn" | ||
- name: Setup Bun | ||
if: ${{ inputs.install-bun == 'true' }} | ||
uses: oven-sh/setup-bun@v1 | ||
- name: Install Foundry | ||
if: ${{ inputs.install-foundry == 'true' }} | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- name: Yarn Install | ||
if: ${{ inputs.yarn-install == 'true' }} | ||
shell: bash | ||
run: yarn install --immutable |
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,42 @@ | ||
name: "Deploy Vercel" | ||
description: "Deploy the project to Vercel. Pulls environment information, builds the project, and deploys it to Vercel. Sets the Vercel alias." | ||
inputs: | ||
vercel-token: | ||
description: "The Vercel token to use for deployment." | ||
required: true | ||
public-hostname: | ||
description: "The public hostname alias to use for the deployment." | ||
required: false | ||
default: "" | ||
outputs: | ||
deployment-url: | ||
description: "The URL of the deployment." | ||
value: ${{ steps.deploy.outputs.deployment_url }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Mask Vercel Token | ||
shell: bash | ||
run: echo "::add-mask::${{ inputs.vercel-token }}" | ||
- name: Switch to Vercel Send team | ||
shell: bash | ||
run: bunx vercel --token=${{ inputs.vercel-token }} team switch 0xsend | ||
- name: Pull Vercel Environment Information | ||
shell: bash | ||
run: bunx vercel --token=${{ inputs.vercel-token }} pull --yes --environment=preview | ||
- name: Build Project Artifacts | ||
shell: bash | ||
run: bunx vercel --token=${{ inputs.vercel-token }} build | ||
- name: Deploy Project Artifacts to Vercel | ||
id: deploy | ||
shell: bash | ||
run: | | ||
bunx vercel --token=${{ inputs.vercel-token }} deploy --prebuilt > deployment-url.txt | ||
echo "deployment_url=$(cat deployment-url.txt)" >> $GITHUB_OUTPUT | ||
echo ::notice::Deployment URL: $(cat deployment-url.txt) | ||
- name: Set Vercel Branch Alias | ||
if: ${{ inputs.public-hostname != '' }} | ||
shell: bash | ||
run: | | ||
bunx vercel --token=${{ inputs.vercel-token }} -S 0xsend alias set ${{ steps.deploy.outputs.deployment_url }} ${{ inputs.public-hostname }} | ||
echo ::notice::Vercel Alias URL https://${{ inputs.public-hostname }}/ |
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
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,84 @@ | ||
name: Deploy Staging | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
||
jobs: | ||
supabase-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
SUPABASE_ACCESS_TOKEN: '' # ${{ secrets.SUPABASE_ACCESS_TOKEN }} | ||
SUPABASE_DB_PASSWORD: '' # ${{ secrets.STAGING_DB_PASSWORD }} | ||
SUPABASE_PROJECT_ID: '' # ${{ secrets.STAGING_PROJECT_ID }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: supabase/setup-cli@v1 | ||
with: | ||
version: latest | ||
|
||
- run: echo todo # supabase link --project-ref $SUPABASE_PROJECT_ID | ||
- run: echo todo # supabase db push | ||
|
||
vercel-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .node-version | ||
cache: 'yarn' | ||
- uses: oven-sh/setup-bun@v1 | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- name: Install Vercel CLI | ||
run: yarn global add vercel | ||
- name: Switch to Vercel Send team | ||
run: vercel --token=${{ secrets.VERCEL_TOKEN }} team switch 0xsend | ||
- name: Pull Vercel Environment Information | ||
run: vercel --token=${{ secrets.VERCEL_TOKEN }} pull --yes --environment=preview | ||
- name: Build Project Artifacts | ||
run: vercel --token=${{ secrets.VERCEL_TOKEN }} build | ||
- name: Extract branch name | ||
shell: bash | ||
run: | | ||
branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | ||
branch="${branch//\//-}" # Replace / with - | ||
branch="${branch//_/-}" # Replace _ with - | ||
branch="${branch,,}" # Convert to lowercase | ||
branch="${branch//[^a-z0-9-]/}" # Remove any character that is not a-z, 0-9, or - | ||
branch="${branch%-}" # Remove trailing hyphen, if any | ||
branch="${branch#-}" # Remove leading hyphen, if any | ||
echo "branch=${branch}" >> $GITHUB_OUTPUT | ||
echo "public_url=https://sendapp-${BRANCH}-0xsend.vercel.app" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
- name: Deploy Project Artifacts to Vercel | ||
id: deploy | ||
run: | | ||
vercel --token=${{ secrets.VERCEL_TOKEN }} deploy --prebuilt \ | ||
--env=NEXT_PUBLIC_URL=${{ steps.extract_branch.outputs.public_url }} \ | ||
> deployment-url.txt && \ | ||
echo "deployment_url=$(cat deployment-url.txt)" >> $GITHUB_OUTPUT | ||
echo ::notice::Deployment URL: $(cat deployment-url.txt) | ||
- name: Set Vercel alias | ||
run: vercel --token=${{ secrets.VERCEL_TOKEN }} -S 0xsend alias set ${{ steps.deploy.outputs.deployment_url }} ${{ steps.extract_branch.outputs.public_url }} |
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 |
---|---|---|
|
@@ -59,10 +59,5 @@ tmp | |
|
||
.parcel-cache | ||
|
||
# Foundry stuff | ||
cache/ | ||
out/ | ||
broadcast | ||
|
||
# ignore for now | ||
Brewfile.lock.json |
This file was deleted.
Oops, something went wrong.
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
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
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,8 @@ | ||
# Foundry stuff | ||
cache/ | ||
out/ | ||
!/broadcast | ||
/broadcast/*/31337/ | ||
/broadcast/**/dry-run/ | ||
/broadcast/**/run-*.json | ||
!/broadcast/**/run-latest.json |
Oops, something went wrong.