diff --git a/.github/workflows/firebasedeploy.yml b/.github/workflows/firebasedeploy.yml new file mode 100644 index 0000000..788605b --- /dev/null +++ b/.github/workflows/firebasedeploy.yml @@ -0,0 +1,45 @@ +name: Deploy MainWeb to Firebase Hosting + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + pull-requests: write + checks: write + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + defaults: + run: + working-directory: sites/mainweb + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Install pnpm + run: npm install -g pnpm + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm build + + - name: Deploy to Firebase Hosting + uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: ${{ secrets.GITHUB_TOKEN }} + firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_DSGT }} + projectId: dsgt-website + channelId: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || 'live' }} + entryPoint: sites/mainweb