Skip to content

Commit

Permalink
Merge pull request #13 from chingu-x/trial-workflow
Browse files Browse the repository at this point in the history
Trial of different Vercel CICD workflow
  • Loading branch information
marktlinn authored Sep 8, 2023
2 parents bcefd6a + bca0661 commit 86bce5e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
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

0 comments on commit 86bce5e

Please sign in to comment.