Skip to content

Commit

Permalink
Merge pull request #55 from Kaffe-diem/bugfix/hosting-yml
Browse files Browse the repository at this point in the history
Add github actions to deploy on git actions
  • Loading branch information
IldenH authored Nov 6, 2024
2 parents 0e4c02c + f4ff781 commit 78ba80e
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 17 deletions.
21 changes: 5 additions & 16 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,15 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "22"

- name: Install dependencies
- name: get deps
run: npm ci

- name: Create env file
# Create .env based on secrets and variables defined in GitHub
run: |
touch .env
echo PUBLIC_PB_HOST=${{ vars.PB_HOST }} >> .env
echo PUBLIC_PB_ADMIN_PASSWORD=${{ secrets.PB_ADMIN_PASSWORD }} >> .env
echo PUBLIC_PB_ADMIN_EMAIL=${{ secrets.PB_ADMIN_EMAIL }} >> .env
# - name: Run npm check
# run: npm run check

- name: Run npm check:format
- name: Check formatting
run: npm run check:format
23 changes: 23 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
on:
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
env:
PUBLIC_PB_HOST: ${{ secrets.PUBLIC_PB_HOST }}
FIREBASE_CLI_EXPERIMENTS: webframeworks
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KAFFE_DIEM }}
channelId: live
projectId: kaffe-diem
24 changes: 24 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

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
env:
PUBLIC_PB_HOST: ${{ secrets.PUBLIC_PB_HOST }}
FIREBASE_CLI_EXPERIMENTS: webframeworks
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KAFFE_DIEM }}
projectId: kaffe-diem
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ src/pb.d.ts
/pocketbase-data

.firebase
.github

0 comments on commit 78ba80e

Please sign in to comment.