-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
125c2d4
commit 8ec703a
Showing
1 changed file
with
22 additions
and
53 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,30 @@ | ||
name: Firebase Auto Deploy | ||
name: React CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
on: [push] | ||
|
||
jobs: | ||
# build: | ||
# name: Build and Test | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: Checkout Code | ||
# uses: actions/checkout@v4 | ||
|
||
# - name: Setup Node | ||
# uses: actions/setup-node@v4 | ||
# with: | ||
# node-version: 'lts/*' | ||
|
||
# - name: Install Dependencies | ||
# run: npm install | ||
|
||
# - name: Build Project | ||
# run: npm run build | ||
|
||
# - name: Run Tests | ||
# run: npm test | ||
deploy: | ||
name: Deploy to Firebase | ||
# needs: build | ||
build: | ||
name: Build and unit test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
node-version: '22' | ||
- run: npm install | ||
- run: npm run build --if-present | ||
- run: npm test | ||
|
||
- name: Cache dependencies 📦 | ||
uses: actions/cache@v4 | ||
deploy: | ||
name: Firebase deploy | ||
needs: [build, cypress] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Build Project | ||
run: npm run build | ||
|
||
- name: Install Firebase Tools | ||
run: npm install -g firebase-tools | ||
|
||
- name: Deploy to Firebase | ||
env: | ||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | ||
run: firebase deploy --token "${{ secrets.FIREBASE_TOKEN }}" --non-interactive | ||
node-version: '22' | ||
- run: npm install | ||
- run: npm run build | ||
- run: npm install -g firebase-tools | ||
- run: firebase deploy --token "${{ secrets.FIREBASE_DEPLOY_TOKEN }}" --non-interactive |