diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e27bf3b..e485696 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -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 diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml new file mode 100644 index 0000000..07ed1cc --- /dev/null +++ b/.github/workflows/firebase-hosting-merge.yml @@ -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 diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml new file mode 100644 index 0000000..53065b3 --- /dev/null +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -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 diff --git a/.gitignore b/.gitignore index 5029ee8..60355bf 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,3 @@ src/pb.d.ts /pocketbase-data .firebase -.github