Skip to content

Commit

Permalink
ci(cd): add deployment for tmp url
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao authored Dec 2, 2024
1 parent 0a45adf commit d6336de
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/deploy-tmp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Deploy old FB

on:
workflow_dispatch:

permissions: read-all

jobs:
dev_deploy:
name: Build and Deploy to Production
if: ${{ github.repository == 'sws2apps/organized-app' && github.ref == 'refs/heads/main' }}
environment:
name: Production
url: https://organized-app.com
runs-on: ubuntu-latest

permissions:
contents: 'read'
id-token: 'write'

steps:
- name: Checkout for release preparation
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: main
persist-credentials: false

- name: Use Node.js LTS version
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version: lts/Iron

- name: Install package dependencies
run: npm ci

- name: Run Semantic Release to version and build App
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
VITE_FIREBASE_APIKEY: ${{ secrets.VITE_FIREBASE_APIKEY }}
VITE_FIREBASE_AUTHDOMAIN: ${{ secrets.VITE_FIREBASE_AUTHDOMAIN }}
VITE_FIREBASE_PROJECTID: ${{ vars.VITE_FIREBASE_PROJECTID }}
VITE_FIREBASE_APPID: ${{ secrets.VITE_FIREBASE_APPID }}

- name: Check if new version has been generated
id: check_build
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6
with:
files: 'dist'

- name: Deploy to Firebase
if: ${{ steps.check_build.outputs.files_exists == 'true' }}
uses: sws2apps/firebase-deployment@f4e1803b78ce7c1b136c532f793c15eb34559b0e
with:
workloadIdentityProvider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
serviceAccount: ${{ secrets.SERVICE_ACCOUNT }}
project: cpe-sws

0 comments on commit d6336de

Please sign in to comment.