-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add auto deploy + undo hide 0 min workouts
- Loading branch information
1 parent
06272e8
commit 1abae6f
Showing
2 changed files
with
67 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Deploy on Main Push | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "src/**" | ||
- "public/**" | ||
- "firebase.json" | ||
- "package.json" | ||
- "index.html" | ||
- "vitest.config.js" | ||
- ".firebaserc" | ||
- ".github/workflows/*" | ||
|
||
concurrency: | ||
group: firebase-deploy-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-and-deploy: | ||
name: 🛠️ Build and Deploy | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 📥 Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🛠️ Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "lts/*" | ||
cache: "npm" | ||
|
||
- name: 📂 Restore npm cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-npm-cache-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-npm-cache- | ||
- name: 📂 Install Packages | ||
run: npm ci | ||
|
||
- name: 🧱 Inject Environment Variables | ||
run: | | ||
echo "VITE_FIREBASE_API_KEY=${{ secrets.FIREBASE_API_KEY }}" >> .env | ||
echo "VITE_FIREBASE_AUTH_DOMAIN=${{ secrets.FIREBASE_AUTH_DOMAIN }}" >> .env | ||
echo "VITE_FIREBASE_DATABASE_URL=${{ secrets.FIREBASE_DATABASE_URL }}" >> .env | ||
echo "VITE_FIREBASE_PROJECT_ID=${{ secrets.FIREBASE_PROJECT_ID }}" >> .env | ||
echo "VITE_FIREBASE_STORAGE_BUCKET=${{ secrets.FIREBASE_STORAGE_BUCKET }}" >> .env | ||
echo "VITE_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}" >> .env | ||
echo "VITE_FIREBASE_APP_ID=${{ secrets.FIREBASE_APP_ID }}" >> .env | ||
- name: 🧱 Build Project | ||
run: npm run build | ||
|
||
- name: 🚀 Deploy to Firebase | ||
if: success() | ||
uses: FirebaseExtended/action-hosting-deploy@v0 | ||
with: | ||
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}" | ||
projectId: "${{ secrets.FIREBASE_PROJECT_ID }}" | ||
channelId: live |
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