Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable deploys on main #881

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 97 additions & 50 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jobs:
.turbo
packages/account-wasm/pkg-controller
packages/account-wasm/pkg-session
key: ${{ runner.os }}-turbo-cache-${{ github.ref_name }}-${{ github.sha }}
key:
${{ runner.os }}-turbo-cache-${{ github.ref_name }}-${{ github.sha
}}
restore-keys: |
${{ runner.os }}-turbo-cache-${{ github.ref_name }}-
${{ runner.os }}-turbo-cache-
Expand All @@ -45,32 +47,43 @@ jobs:
- name: Build
run: pnpm build:deps
- name: Pull Vercel Environment Information (Preview)
if: github.ref != 'refs/heads/main'
run: pnpm vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref != 'refs/heads/release'
run:
pnpm vercel pull --yes --environment=preview --token=${{
secrets.VERCEL_TOKEN }}
- name: Pull Vercel Environment Information (Production)
if: github.ref == 'refs/heads/main'
run: pnpm vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref == 'refs/heads/release'
run:
pnpm vercel pull --yes --environment=production --token=${{
secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts (Preview)
if: github.ref != 'refs/heads/main'
if: github.ref != 'refs/heads/release'
run: pnpm vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts (Production)
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/release'
run: pnpm vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel (Preview)
if: github.ref != 'refs/heads/main'
run: echo "url=$(pnpm vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" > "$GITHUB_OUTPUT"
if: github.ref != 'refs/heads/release'
run:
echo "url=$(pnpm vercel deploy --prebuilt --token=${{
secrets.VERCEL_TOKEN }})" > "$GITHUB_OUTPUT"
id: deploy
- name: Deploy to Vercel (Production)
if: github.ref == 'refs/heads/main'
run: pnpm vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref == 'refs/heads/release'
run:
pnpm vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN
}}
- name: Set outputs
id: vars
run: |
git config --global --add safe.directory '*'
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Assign Alias
if: github.ref != 'refs/heads/main'
run: pnpm vercel alias set ${{ steps.deploy.outputs.url }} keychain-${{ steps.vars.outputs.sha_short }}.preview.cartridge.gg --scope=cartridge --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref != 'refs/heads/release'
run:
pnpm vercel alias set ${{ steps.deploy.outputs.url }} keychain-${{
steps.vars.outputs.sha_short }}.preview.cartridge.gg --scope=cartridge
--token=${{ secrets.VERCEL_TOKEN }}

keychain-storybook:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -100,7 +113,9 @@ jobs:
.turbo
packages/account-wasm/pkg-controller
packages/account-wasm/pkg-session
key: ${{ runner.os }}-turbo-cache-${{ github.ref_name }}-${{ github.sha }}
key:
${{ runner.os }}-turbo-cache-${{ github.ref_name }}-${{ github.sha
}}
restore-keys: |
${{ runner.os }}-turbo-cache-${{ github.ref_name }}-
${{ runner.os }}-turbo-cache-
Expand All @@ -109,32 +124,44 @@ jobs:
- name: Build
run: pnpm build:deps
- name: Pull Vercel Environment Information (Preview)
if: github.ref != 'refs/heads/main'
run: pnpm vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref != 'refs/heads/release'
run:
pnpm vercel pull --yes --environment=preview --token=${{
secrets.VERCEL_TOKEN }}
- name: Pull Vercel Environment Information (Production)
if: github.ref == 'refs/heads/main'
run: pnpm vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref == 'refs/heads/release'
run:
pnpm vercel pull --yes --environment=production --token=${{
secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts (Preview)
if: github.ref != 'refs/heads/main'
if: github.ref != 'refs/heads/release'
run: pnpm vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts (Production)
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/release'
run: pnpm vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel (Preview)
if: github.ref != 'refs/heads/main'
run: echo "url=$(pnpm vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" > "$GITHUB_OUTPUT"
if: github.ref != 'refs/heads/release'
run:
echo "url=$(pnpm vercel deploy --prebuilt --token=${{
secrets.VERCEL_TOKEN }})" > "$GITHUB_OUTPUT"
id: deploy
- name: Deploy to Vercel (Production)
if: github.ref == 'refs/heads/main'
run: pnpm vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref == 'refs/heads/release'
run:
pnpm vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN
}}
- name: Set outputs
id: vars
run: |
git config --global --add safe.directory '*'
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Assign Alias
if: github.ref != 'refs/heads/main'
run: pnpm vercel alias set ${{ steps.deploy.outputs.url }} keychain-storybook-${{ steps.vars.outputs.sha_short }}.preview.cartridge.gg --scope=cartridge --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref != 'refs/heads/release'
run:
pnpm vercel alias set ${{ steps.deploy.outputs.url }}
keychain-storybook-${{ steps.vars.outputs.sha_short
}}.preview.cartridge.gg --scope=cartridge --token=${{
secrets.VERCEL_TOKEN }}

profile:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -164,7 +191,9 @@ jobs:
.turbo
packages/account-wasm/pkg-controller
packages/account-wasm/pkg-session
key: ${{ runner.os }}-turbo-cache-${{ github.ref_name }}-${{ github.sha }}
key:
${{ runner.os }}-turbo-cache-${{ github.ref_name }}-${{ github.sha
}}
restore-keys: |
${{ runner.os }}-turbo-cache-${{ github.ref_name }}-
${{ runner.os }}-turbo-cache-
Expand All @@ -173,33 +202,43 @@ jobs:
- name: Build
run: pnpm build:deps
- name: Pull Vercel Environment Information (Preview)
if: github.ref != 'refs/heads/main'
run: pnpm vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref != 'refs/heads/release'
run:
pnpm vercel pull --yes --environment=preview --token=${{
secrets.VERCEL_TOKEN }}
- name: Pull Vercel Environment Information (Production)
if: github.ref == 'refs/heads/main'
run: pnpm vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref == 'refs/heads/release'
run:
pnpm vercel pull --yes --environment=production --token=${{
secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts (Preview)
if: github.ref != 'refs/heads/main'
if: github.ref != 'refs/heads/release'
run: pnpm vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts (Production)
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/release'
run: pnpm vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel (Preview)
if: github.ref != 'refs/heads/main'
run: echo "url=$(pnpm vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" > "$GITHUB_OUTPUT"
if: github.ref != 'refs/heads/release'
run:
echo "url=$(pnpm vercel deploy --prebuilt --token=${{
secrets.VERCEL_TOKEN }})" > "$GITHUB_OUTPUT"
id: deploy
- name: Deploy to Vercel (Production)
if: github.ref == 'refs/heads/main'
run: pnpm vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref == 'refs/heads/release'
run:
pnpm vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN
}}
- name: Set outputs
id: vars
run: |
git config --global --add safe.directory '*'
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Assign Alias
if: github.ref != 'refs/heads/main'
run: pnpm vercel alias set ${{ steps.deploy.outputs.url }} profile-${{ steps.vars.outputs.sha_short }}.preview.cartridge.gg --scope=cartridge --token=${{ secrets.VERCEL_TOKEN }}

if: github.ref != 'refs/heads/release'
run:
pnpm vercel alias set ${{ steps.deploy.outputs.url }} profile-${{
steps.vars.outputs.sha_short }}.preview.cartridge.gg --scope=cartridge
--token=${{ secrets.VERCEL_TOKEN }}

cartridge-starknet-react-next:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -229,7 +268,9 @@ jobs:
.turbo
packages/account-wasm/pkg-controller
packages/account-wasm/pkg-session
key: ${{ runner.os }}-turbo-cache-${{ github.ref_name }}-${{ github.sha }}
key:
${{ runner.os }}-turbo-cache-${{ github.ref_name }}-${{ github.sha
}}
restore-keys: |
${{ runner.os }}-turbo-cache-${{ github.ref_name }}-
${{ runner.os }}-turbo-cache-
Expand All @@ -238,28 +279,34 @@ jobs:
- name: Build
run: pnpm build:deps
- name: Pull Vercel Environment Information (Preview)
if: github.ref != 'refs/heads/main'
run: pnpm vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref != 'refs/heads/release'
run:
pnpm vercel pull --yes --environment=preview --token=${{
secrets.VERCEL_TOKEN }}
- name: Pull Vercel Environment Information (Production)
if: github.ref == 'refs/heads/main'
run: pnpm vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref == 'refs/heads/release'
run:
pnpm vercel pull --yes --environment=production --token=${{
secrets.VERCEL_TOKEN }}
- name: Set outputs
id: vars
run: |
git config --global --add safe.directory '*'
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build Project Artifacts (Preview)
if: github.ref != 'refs/heads/main'
if: github.ref != 'refs/heads/release'
run: |
echo "NEXT_PUBLIC_KEYCHAIN_DEPLOYMENT_URL=https://keychain-${{ steps.vars.outputs.sha_short }}.preview.cartridge.gg" >> ./examples/starknet-react-next/.env.local
echo "NEXT_PUBLIC_PROFILE_DEPLOYMENT_URL=https://profile-${{ steps.vars.outputs.sha_short }}.preview.cartridge.gg" >> ./examples/starknet-react-next/.env.local
pnpm vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts (Production)
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/release'
run: pnpm vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel (Preview)
if: github.ref != 'refs/heads/main'
if: github.ref != 'refs/heads/release'
run: pnpm vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel (Production)
if: github.ref == 'refs/heads/main'
run: pnpm vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
if: github.ref == 'refs/heads/release'
run:
pnpm vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN
}}
Loading