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

Trial of different Vercel CICD workflow #13

Merged
merged 2 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
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
29 changes: 16 additions & 13 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Deploy PR to Preview
name: Deploy to Vercel Preview
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
pull_request:
workflow_dispatch:
push:
branches:
[main, dev]
- premium-strip

jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -18,12 +19,14 @@ jobs:
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: build project artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy preview
id: preview-deploy
run: echo "URL=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | tail -n 1)" >> $GITHUB_OUTPUT
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Preview URL ${{ steps.preview-deploy.outputs.URL }}
comment_tag: execution
- name: deploy preview + assign beta domain
run: |
OUTPUT=$(du --inodes -d 5 .vercel/output)
echo "$OUTPUT"
LAST=$(echo "$OUTPUT" | tail -n 1)
PERCENTAGE=$(echo "$LAST" | awk 'BEGIN {maxtotal=15000} { printf "%.2f%%", ($1/maxtotal*100) }')
echo "Vercel file usage percentage" >> $GITHUB_STEP_SUMMARY
echo "$PERCENTAGE" >> $GITHUB_STEP_SUMMARY
du -h -d 3 .vercel/output/functions/en
vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > domain.txt
vercel alias --scope ${{ secrets.VERCEL_TEAM_ID }} --token ${{ secrets.VERCEL_TOKEN }} set `cat domain.txt` biodrop-preview.vercel.app
4 changes: 3 additions & 1 deletion src/app/ideation/components/VoteCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ function VoteCard({ users, voted }: VoteCardProps) {
<h1 className="text-3xl font-semibold text-neutral-focus">
{users.length}
</h1>
<h2 className="text-xl font-semibold text-neutral-focus">{`Vote${users.length > 1 ? "s" : ""}`}</h2>
<h2 className="text-xl font-semibold text-neutral-focus">{`Vote${
users.length > 1 ? "s" : ""
}`}</h2>
<div className="avatar-group -space-x-2 w-full">
{users.map((user) => (
<Avatar width={24} height={24} key={user} />
Expand Down
Loading