Skip to content

Created .nvmrc with node v18.19.0 #25

Created .nvmrc with node v18.19.0

Created .nvmrc with node v18.19.0 #25

name: things-to-do production onpush
# Controls when the action will run.
on:
# Triggers the workflow on push events but only for the master branch
push:
branches: [production]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
install:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Cache node_modules
id: cache-node-modules-pre
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-build-thingstodo-node-modules-${{ hashFiles('package-lock.json') }}
- name: Install node_modules
if: steps.cache-node-modules-pre.outputs.cache-hit != 'true'
run: npm install
check:
needs: [install]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-build-thingstodo-node-modules-${{ hashFiles('package-lock.json') }}
- name: Run linter
run: npm run lint
- name: Run unit tests
run: npm run test:headless
- name: Run e2e tests
uses: cypress-io/github-action@v6
with:
start: npm run start
browser: chrome
build:
needs: [check]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-build-thingstodo-node-modules-${{ hashFiles('package-lock.json') }}
- name: Build things-to-do project
run: npm run build:prod
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-things-to-do
path: dist/things-to-do
deploy:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-build-thingstodo-node-modules-${{ hashFiles('package-lock.json') }}
- uses: actions/download-artifact@v4
with:
name: dist-things-to-do
path: dist/things-to-do
- name: Install firebase-tools package globally
run: sudo npm install -g firebase-tools@11.30.0
- name: Deploy things-to-do project to firebase
run: firebase deploy
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}