Skip to content

Commit

Permalink
Added CD (previews + deploys) (#150)
Browse files Browse the repository at this point in the history
jwngr authored Jun 19, 2024
1 parent ddb667f commit d27815b
Showing 5 changed files with 45 additions and 4 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Deploy to Firebase Hosting on merge
on:
push:
branches:
- master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
working-directory: website
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SDOW_PROD }}
channelId: live
projectId: sdow-prod
19 changes: 19 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy to Firebase Hosting on PR
on: pull_request
permissions:
checks: write
contents: read
pull-requests: write
jobs:
build_and_preview:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
working-directory: website
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SDOW_PROD }}
projectId: sdow-prod
2 changes: 1 addition & 1 deletion .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: frontend-ci
name: Frontend CI
on: [push]
jobs:
frontend-ci:
8 changes: 6 additions & 2 deletions website/firebase.json → firebase.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"hosting": {
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"public": "website/dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [
{
"source": "/service-worker.js",
2 changes: 1 addition & 1 deletion website/.firebaserc
Original file line number Diff line number Diff line change
@@ -3,4 +3,4 @@
"default": "sdow-prod",
"staging": "sdow-staging"
}
}
}

0 comments on commit d27815b

Please sign in to comment.