Merge pull request #23 from devfestindia/herodata #22
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: Deploy App | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Node.js version | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Install Firebase CLI | |
run: | | |
npm install -g firebase-tools | |
- name: Get node env variables | |
id: node-env | |
run: | | |
echo "dir=$(npm config get cache)" >> GITHUB_OUTPUT | |
echo "version=$(node -v)" >> GITHUB_OUTPUT | |
- name: Restore Cache | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
path: | | |
${{steps.node-env.outputs.dir}} | |
node_modules | |
key: ${{runner.os}}-node-${{steps.node-env.outputs.version}}-${{hashFiles('./package-lock.json')}} | |
restore-keys: | | |
${{runner.os}}-node- | |
${{runner.os}}- | |
- name: Install Packages | |
if: ${{steps.cache.outputs.cache-hit != 'true'}} | |
run: | | |
echo npm cache hit $(["${{steps.cache.outputs.cache-hit}}" == "true"] && echo "on" || echo "off") | |
npm install | |
- name: Generating Static Files | |
run: | | |
npm run generate | |
- name: Deploying App to Firebase | |
run: firebase deploy |