-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* deploy on dev * add staging deploy * fix it * checkout deploy-staging * fix deploy preview * fix ci.yml * fix ci * fix deploy * deploy it * fix public hostname deploy
- Loading branch information
Showing
10 changed files
with
228 additions
and
115 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,58 @@ | ||
name: Deploy | ||
description: "Deploy the project to Vercel and Supabase." | ||
inputs: | ||
vercel-token: | ||
description: "The Vercel token to use for deployment." | ||
required: true | ||
vercel-org-id: | ||
description: "The Vercel organization ID to use for deployment." | ||
required: true | ||
vercel-project-id: | ||
description: "The Vercel project ID to use for deployment." | ||
required: true | ||
production: | ||
description: "Whether to deploy to the production environment." | ||
required: false | ||
default: "false" | ||
supabase-project-id: | ||
description: "The Supabase project ID to use for deployment." | ||
required: true | ||
supabase-access-token: | ||
description: "The Supabase access token to use for deployment." | ||
required: true | ||
supabase-db-password: | ||
description: "The Supabase database password to use for deployment." | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Environment | ||
uses: ./.github/actions/setup-env | ||
with: | ||
yarn-install: false | ||
env: | ||
YARN_ENABLE_HARDENED_MODE: "0" | ||
- name: Supabase Deploy | ||
id: deploy | ||
uses: ./.github/actions/supabase-deploy | ||
with: | ||
supabase-project-id: ${{ inputs.supabase-project-id }} | ||
supabase-access-token: ${{ inputs.supabase-access-token }} | ||
supabase-db-password: ${{ inputs.supabase-db-password }} | ||
- name: Extract Branch | ||
id: extract-branch | ||
uses: ./.github/actions/extract-branch | ||
- name: Public Hostname | ||
shell: bash | ||
id: public-hostname | ||
run: echo "public-hostname=sendapp-${{steps.extract-branch.outputs.branch}}-0xsend.vercel.app" >> $GITHUB_OUTPUT | ||
- name: Vercel Deploy | ||
uses: ./.github/actions/vercel-deploy | ||
with: | ||
vercel-token: ${{ inputs.vercel-token }} | ||
vercel-org-id: ${{ inputs.vercel-org-id }} | ||
vercel-project-id: ${{ inputs.vercel-project-id }} | ||
public-hostname: ${{ steps.public-hostname.outputs.public-hostname }} | ||
production: ${{ inputs.production }} | ||
env: | ||
YARN_ENABLE_HARDENED_MODE: "0" |
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,21 @@ | ||
name: "Extract Branch Name" | ||
description: "Extract the branch name from the GitHub event payload and set it as an output cleaned for use in Vercel." | ||
outputs: | ||
branch: | ||
description: "The cleaned branch name." | ||
value: ${{ steps.extract.outputs.branch }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Extract Branch Name | ||
id: extract | ||
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 |
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,37 @@ | ||
name: Supabase Deploy Migrations | ||
description: "Deploy the project to Supabase. Run migrations against the database." | ||
inputs: | ||
supabase-project-id: | ||
description: "The Supabase project ID to use for deployment." | ||
required: true | ||
supabase-access-token: | ||
description: "The Supabase access token to use for deployment." | ||
required: true | ||
supabase-db-password: | ||
description: "The Supabase database password to use for deployment." | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Mask Supabase Access Token | ||
shell: bash | ||
run: echo "::add-mask::${{ inputs.supabase-access-token }}" | ||
- name: Mask Supabase Database Password | ||
shell: bash | ||
run: echo "::add-mask::${{ inputs.supabase-db-password }}" | ||
- name: Mask Supabase Project ID | ||
shell: bash | ||
run: echo "::add-mask::${{ inputs.supabase-project-id }}" | ||
- uses: supabase/setup-cli@v1 | ||
with: | ||
version: latest | ||
- shell: bash | ||
run: supabase link --project-ref ${{ inputs.supabase-project-id }} | ||
env: | ||
SUPABASE_ACCESS_TOKEN: ${{ inputs.supabase-access-token }} | ||
SUPABASE_DB_PASSWORD: ${{ inputs.supabase-db-password }} | ||
- shell: bash | ||
run: supabase db push | ||
env: | ||
SUPABASE_ACCESS_TOKEN: ${{ inputs.supabase-access-token }} | ||
SUPABASE_DB_PASSWORD: ${{ inputs.supabase-db-password }} |
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,45 @@ | ||
name: Deploy Staging | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
secrets: | ||
VERCEL_TOKEN: | ||
description: 'Vercel token' | ||
required: true | ||
VERCEL_PROJECT_ID: | ||
description: 'Vercel project id' | ||
required: true | ||
VERCEL_ORG_ID: | ||
description: 'Vercel org id' | ||
required: true | ||
SUPABASE_ACCESS_TOKEN: | ||
description: 'Supabase access token' | ||
required: true | ||
STAGING_SUPABASE_PROJECT_ID: | ||
description: 'Staging Supabase project id' | ||
required: true | ||
STAGING_SUPABASE_DB_PASSWORD: | ||
description: 'Staging Supabase db password' | ||
required: true | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Deploy | ||
uses: ./.github/actions/deploy | ||
with: | ||
vercel-token: ${{ secrets.VERCEL_TOKEN }} | ||
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | ||
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | ||
production: false | ||
supabase-project-id: ${{ secrets.STAGING_SUPABASE_PROJECT_ID }} | ||
supabase-access-token: ${{ secrets.SUPABASE_ACCESS_TOKEN }} | ||
supabase-db-password: ${{ secrets.STAGING_SUPABASE_DB_PASSWORD }} |
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
Oops, something went wrong.