fix: ajouter espacement entre element dans /feed #164
Workflow file for this run
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
name: Create/Delete Branch for Pull Request | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- closed | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
setup: | |
name: Setup | |
outputs: | |
branch: ${{ steps.branch_name.outputs.current_branch }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get branch name | |
id: branch_name | |
uses: tj-actions/branch-names@v8 | |
create_neon_branch: | |
name: Create Neon Branch | |
outputs: | |
db_url: ${{ steps.create_neon_branch_encode.outputs.db_url }} | |
db_url_with_pooler: ${{ steps.create_neon_branch_encode.outputs.db_url_with_pooler }} | |
needs: setup | |
if: | | |
github.event_name == 'pull_request' && ( | |
github.event.action == 'synchronize' | |
|| github.event.action == 'opened' | |
|| github.event.action == 'reopened') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 9 | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Setup Biome | |
uses: biomejs/setup-biome@v2 | |
with: | |
version: latest | |
- name: Run Biome | |
run: biome ci . | |
- name: Create Neon Branch | |
id: create_neon_branch | |
uses: neondatabase/create-branch-action@v5 | |
with: | |
project_id: ${{ vars.NEON_PROJECT_ID }} | |
branch_name: preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }} | |
api_key: ${{ secrets.NEON_API_KEY }} | |
# It's important you don't log the DATABASE_URL as output as it contains a username and | |
# password for your database. | |
# For example, you can uncomment the lines below to run a database migration command: | |
- name: Run Migrations | |
# to use pooled connection | |
# DATABASE_URL: "${{ steps.create_neon_branch.outputs.db_url_with_pooler }}" | |
# OR to use unpooled connection | |
# DATABASE_URL: "${{ steps.create_neon_branch.outputs.db_url }}" | |
run: | | |
touch .env | |
echo DATABASE_URL=${{ steps.create_neon_branch.outputs.db_url_with_pooler }} >> .env | |
echo DIRECT_URL=${{ steps.create_neon_branch.outputs.db_url }} >> .env | |
pnpm drizzle-kit generate | |
pnpm drizzle-kit migrate | |
- name: Post Schema Diff Comment to PR | |
uses: neondatabase/schema-diff-action@v1 | |
with: | |
project_id: ${{ vars.NEON_PROJECT_ID }} | |
compare_branch: preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }} | |
api_key: ${{ secrets.NEON_API_KEY }} | |
- name: Install Vercel CLI | |
run: pnpm install --global vercel@latest | |
- name: Pull Vercel Environment Information | |
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build Project Artifacts | |
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
id: deploy | |
run: | | |
VERCEL_URL=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} \ | |
-e DATABASE_URL="${{ steps.create_neon_branch.outputs.db_url_with_pooler }}" \ | |
-e DIRECT_URL="${{ steps.create_neon_branch.outputs.db_url }}") | |
echo "preview_url=$VERCEL_URL" >> $GITHUB_OUTPUT | |
- name: Comment on PR | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
Vercel Preview URL 🚀 : ${{ steps.deploy.outputs.preview_url }} | |
Neon branch 🐘 : https://console.neon.tech/app/projects/${{ vars.NEON_PROJECT_ID }}/branches/${{ steps.create_neon_branch.outputs.branch_id }} | |
delete_neon_branch: | |
name: Delete Neon Branch | |
needs: setup | |
if: github.event_name == 'pull_request' && github.event.action == 'closed' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Delete Neon Branch | |
uses: neondatabase/delete-branch-action@v3 | |
with: | |
project_id: ${{ vars.NEON_PROJECT_ID }} | |
branch: preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }} | |
api_key: ${{ secrets.NEON_API_KEY }} |