Merge pull request #303 from eficode/feat-Manual-PR-pipeline-trigger #189
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: Build and deploy on dev | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy-dev: | |
runs-on: ubuntu-latest | |
environment: dev | |
steps: | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Checkout merged code | |
uses: actions/checkout@v2 | |
- name: Retrieve npm cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Bootstrap | |
run: npm run bootstrap | |
- name: Build project | |
run: npm run build | |
env: | |
REACT_APP_FIREBASE_CONFIG_API_KEY: ${{ secrets.REACT_APP_FIREBASE_CONFIG_API_KEY }} | |
REACT_APP_FIREBASE_CONFIG_AUTH_DOMAIN: ${{ secrets.REACT_APP_FIREBASE_CONFIG_AUTH_DOMAIN }} | |
REACT_APP_FIREBASE_CONFIG_DATABASE_URL: ${{ secrets.REACT_APP_FIREBASE_CONFIG_DATABASE_URL }} | |
REACT_APP_FIREBASE_CONFIG_PROJECT_ID: ${{ secrets.REACT_APP_FIREBASE_CONFIG_PROJECT_ID }} | |
REACT_APP_FIREBASE_CONFIG_STORAGE_BUCKET: ${{ secrets.REACT_APP_FIREBASE_CONFIG_STORAGE_BUCKET }} | |
REACT_APP_FIREBASE_CONFIG_MESSAGING_SENDER_ID: ${{ secrets.REACT_APP_FIREBASE_CONFIG_MESSAGING_SENDER_ID }} | |
REACT_APP_FIREBASE_CONFIG_APP_ID: ${{ secrets.REACT_APP_FIREBASE_CONFIG_APP_ID }} | |
REACT_APP_ENV: dev | |
- name: Setup database target | |
run: npm run scripts:deploy-database-instances-rules | |
env: | |
FIREBASE_PROJECT_ID: ${{ secrets.REACT_APP_FIREBASE_CONFIG_PROJECT_ID }} | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |
- name: Deploy | |
run: npx firebase deploy --project $FIREBASE_PROJECT_ID --token "$FIREBASE_TOKEN" --force | |
env: | |
FIREBASE_PROJECT_ID: ${{ secrets.REACT_APP_FIREBASE_CONFIG_PROJECT_ID }} | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |