GithubHelp home page GithubHelp logo

nuxt-content-tutorial's Introduction

Nuxt.js Content Blog

Learn how to build and deploy a Nuxt.js blog website to Firebase. ๐ŸŽˆ

Start by adding your firebase project

Note you'll need to install firebase:

npm i -g firebase-tools@latest

You'll need to be authenticated to your firebase project.

firebase login

If you don't have a project yet, run the following and follow the steps:

firebase projects:create

To initialize your blog run:

firebase init hosting

The options below will allow your code to deploy automatically to your firebase hosting everytime you push to your main branch.

  • ? What do you want to use as your public directory? dist
  • ? Configure as a single-page app (rewrite all urls to /index.html)? (y/N) N
  • ? Set up automatic builds and deploys with GitHub? y
  • ? For which GitHub repository would you like to set up a GitHub workflow? (format: user/repository) (/nuxt-content-tutorial)
  • ? Set up the workflow to run a build script before every deploy? (y/N) y
  • ? What script should be run before every deploy? (npm ci && npm run build) npm run test && npm run generate
  • ? Set up automatic deployment to your site's live channel when a PR is merged? (Y/n) Y
  • ? What is the name of the GitHub branch associated with your site's live channel? main

Note

Check the .github/workflows directory after this command. Make sure only merge option exists and correct build script is listed.

The working workflow file

.github/workflows/firebase-hosting-merge.yml

# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
'on':
  push:
    branches:
      - main
jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Install dependencies
        run: yarn

      - name: Generate
        run: yarn generate

      - name: Deploy
        uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: '${{ secrets.GITHUB_TOKEN }}'
          firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_KAIZEN_CODES_BLOG }}'
          channelId: live
          projectId: kaizen-codes-blog

nuxt-content-tutorial's People

Contributors

eckhardt-d avatar

Stargazers

Yogen P avatar Kebal avatar Sam Jacob avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.