feat: firebase hosting deploy by github actions #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Firebase Hosting on PR | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/preview-pull-request.yaml' | |
- '**' | |
jobs: | |
deploy_web: | |
name: Web Firebase Hosting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
- name: build | |
run: | | |
npm ci | |
npx ng add angular-cli-ghpages --skip-confirmation | |
npx ng build --base-href=/2024/ | |
- name: lint | |
run: npm run lint | |
- name: Deploy to Firebase | |
uses: FirebaseExtended/action-hosting-deploy@v0 | |
with: | |
entryPoint: "./" | |
repoToken: "${{ secrets.GITHUB_TOKEN }}" | |
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}" | |
projectId: "${{ secrets.PROJECT_ID }}" | |
channelId: ${{ github.head_ref }} |