From edab9adff3a8b200750177b2ee50caf8a0531def Mon Sep 17 00:00:00 2001 From: Xinyu Ma Date: Sat, 11 Nov 2023 04:39:09 -0800 Subject: [PATCH] Add CI --- .github/workflows/deploy-firebase.yaml | 47 ++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/deploy-firebase.yaml diff --git a/.github/workflows/deploy-firebase.yaml b/.github/workflows/deploy-firebase.yaml new file mode 100644 index 0000000..0ec6678 --- /dev/null +++ b/.github/workflows/deploy-firebase.yaml @@ -0,0 +1,47 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy to Firebase Hosting on merge + +on: + # Runs on pushes targeting the default branch + push: + branches: ['main'] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: 'pages' + cancel-in-progress: true + +jobs: + # Single deploy job since we're just deploying + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 21 + cache: 'pnpm' + - name: Install dependencies + run: pnpm install + - name: Build + run: pnpm build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZJKMXY }}' + channelId: live + projectId: zjkmxy