Git Product home page Git Product logo

action-hugo-firebase-deploy's Introduction

Github Action (Hugo Build & Deployment to Firebase)

The following Github Action will successfully build and deploy your Hugo static-site and upload it to Google Firebase Hosting.

Pre-requisites

  • You will need a Firebase Project. If you haven't already got one you can easily get one here: Firebase Console
  • You will need a Firebase Token in-order for this to run.

Getting Started

You will need firebase tools installed on your local machine to obtain a firebase token. If you haven't got it installed then you can install it by running npm install -g firebase-tools.

  • Log in to Firebase (setup on your local machine) using firebase login, which opens a browser where you can select your account. Use firebase logout in case you are already logged in but to the wrong account.
  • In the root of your Hugo project, initialize the Firebase project with the firebase init command. From here:
    • Choose Hosting in the feature question
    • Choose the project you just set up
    • Accept the default for your database rules file
    • Accept the default for the publish directory, which is public
    • Choose โ€œNoโ€ in the question if you are deploying a single-page app
  • You can generate a deploy token using firebase login:ci
  • Your Firebase token is sensitive information so it will need to be setup as a Github Secret.
  • Once completed you are ready to setup your action.

Setting up Actions

Within your repo select the Actions tab. Create a new workflow and paste the following:

on: [push]
name: Deploy Hugo to Firebase
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
      with:
        submodules: true
    - uses: ryank90/action-hugo-firebase-deploy@master
      with:
        firebase-token: ${{ secrets.firebase_token }}
        hugo-params: -D // Optional. Any params for the `hugo` command. [Refer doc here](https://gohugo.io/commands/hugo/) 

Save and you are ready to push code to your repo and have it deployed.

action-hugo-firebase-deploy's People

Contributors

ryank90 avatar rahulbagal avatar vigneshpt 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.