Skip to content

Commit

Permalink
Merge pull request #15 from gakuseiBOT/dev/vercel
Browse files Browse the repository at this point in the history
🚀 Add Vercel deployment workflows for preview and production
テストもかねてバイパス
  • Loading branch information
yuito-it authored Jan 26, 2025
2 parents a96c68f + ab6d634 commit 306af78
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/VercelPreview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Vercel Preview Deployment
on:
pull_request:
branches:
- main
jobs:
deployment:
runs-on: ubuntu-latest
concurrency: Preview
environment:
name: Preview
url: ${{ steps.get_release_url.outputs.release_url }}
steps:
- uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install -g vercel
- name: Link Vercel Project
run: vercel link --token=${{secrets.VERCEL_TOKEN}} --project ${{secrets.VERCEL_PROJECT}} --yes
- name: Deploy with Vercel
run: vercel deploy --target=staging --token=${{secrets.VERCEL_TOKEN}}
- name: Set release url
id: get_release_url
run: echo release_url=$(cat deployment-url.txt) >> $GITHUB_OUTPUT
- name: Comment on PR
run: |
cat << EOF > comment.md
## :rocket: Preview Deployment
[Preview Deployment](${{ steps.get_release_url.outputs.release_url }})
EOF
gh pr comment ${{ github.event.number }} --body-file comment.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/VercelProduct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Vercel Production Deployment
on:
push:
branches:
- main
jobs:
deployment:
runs-on: ubuntu-latest
concurrency: Production
environment:
name: Production
url: ${{ steps.get_release_url.outputs.release_url }}
steps:
- uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install -g vercel
- name: Link Vercel Project
run: vercel link --token=${{secrets.VERCEL_TOKEN}} --project ${{secrets.VERCEL_PROJECT}} --yes
- name: Deploy with Vercel
run: vercel deploy --prod --token=${{secrets.VERCEL_TOKEN}} >deployment-url.txt 2>error.txt
- name: Set release url
id: get_release_url
run: echo release_url=$(cat deployment-url.txt) >> $GITHUB_OUTPUT

7 changes: 7 additions & 0 deletions posts/announce/00001.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: 公式サイトをリニューアルしました!
date: 2025-01-27T00:30:00+09:00
description: この度、公式サイトを見やすくリニューアルしました!
---

## Test
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function Home() {
</section>
<section className='w-full min-h-[370px] flex flex-col items-center space-y-5 p-5 justify-center'>
<h1 className='text-2xl font-semibold'>最新のお知らせ</h1>
<PostList posts={posts} dirname='announce' className='lg:w-2/5 w-4/5 mx-auto h-[90px] justify-center' />
<PostList posts={posts} dirname='announce' className='lg:w-2/5 w-4/5 mx-auto min-h-[90px] justify-center' />
</section>
<section id="join" className="flex space-y-5 items-center min-w-full lg:p-20 p-10 flex-col bg-gray-100">
<h3 className="text-2xl font-semibold">
Expand Down

0 comments on commit 306af78

Please sign in to comment.