forked from external-repos/LifeTrinket
60 lines
1.6 KiB
YAML
60 lines
1.6 KiB
YAML
name: Deploy to Firebase Hosting
|
|
'on':
|
|
push:
|
|
tags:
|
|
- '*'
|
|
jobs:
|
|
build_and_deploy:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
VITE_REPO_READ_ACCESS_TOKEN: ${{ secrets.REPO_READ_ACCESS_TOKEN }}
|
|
VITE_FIREBASE_ANALYTICS_API_KEY: ${{ secrets.FIREBASE_ANALYTICS_API_KEY }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup bun
|
|
uses: oven-sh/setup-bun@v1
|
|
|
|
- name: Build, lint, and deploy
|
|
run: |
|
|
bun install
|
|
bun run build
|
|
bun run lint
|
|
- name: Deploy to Firebase Hosting
|
|
uses: FirebaseExtended/action-hosting-deploy@v0
|
|
with:
|
|
repoToken: '${{ secrets.GITHUB_TOKEN }}'
|
|
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_LIFE_TRINKET }}'
|
|
channelId: live
|
|
projectId: life-trinket
|
|
|
|
release:
|
|
needs: build_and_deploy
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
working-directory: ${{ github.workspace }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: get version
|
|
id: version
|
|
uses: notiz-dev/github-action-json-property@v0.2.0
|
|
|
|
with:
|
|
path: 'package.json'
|
|
prop_path: 'version'
|
|
|
|
- name: Create Release Note
|
|
id: create_release_note
|
|
run: echo "Release Note for version ${{ steps.version.outputs.prop }}" > release_note.txt
|
|
|
|
- name: Create Release
|
|
uses: ncipollo/release-action@v1.13.0
|
|
with:
|
|
bodyFile: release_note.txt
|
|
commit: ${{ github.sha }}
|
|
tag: '${{ steps.version.outputs.prop }}'
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|