Skip to content

Feat/time preferences backend #11

Feat/time preferences backend

Feat/time preferences backend #11

name: Firebase Preview Deploy
on:
pull_request:
branches:
- main
jobs:
deploy-preview:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm install
- name: Build the app
run: npm run build
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Deploy to Firebase Preview Channel
id: firebase_deploy
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
run: |
firebase hosting:channel:deploy pr-${{ github.event.number }} --expires 2d | tee deploy-output.txt
- name: Extract Preview URL
id: extract_url
run: |
# Find the actual preview URL from the Firebase deploy output
URL=$(grep -oP 'https:\/\/[^\s]+pr-${{ github.event.number }}[^\s]+' deploy-output.txt)
echo "PREVIEW_URL=${URL}" >> $GITHUB_ENV
- name: Post preview link to PR
uses: actions/github-script@v7
with:
script: |
const previewUrl = process.env.PREVIEW_URL;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🚀 Preview for this PR is available at: ${previewUrl}`
});