# Hugo + bitbucket + firebase

**URL:** <https://discourse.gohugo.io/t/hugo-bitbucket-firebase/14970>\
**Category:** support\
**Created:** [October 29, 2018, 5:00pm UTC](https://discourse.gohugo.io/t/hugo-bitbucket-firebase/14970 "2018-10-29T17:00:44Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)\
**Post date:** [October 31, 2018, 3:21pm UTC](https://discourse.gohugo.io/t/hugo-bitbucket-firebase/14970/16 "2018-10-31T15:21:35Z")

</div>

@exrishu I was curious about this, so I got it working for one of my sample projects. I followed the [hugo docs for hosting on firebase](https://gohugo.io/hosting-and-deployment/hosting-on-firebase/), as is.

My sample project, now in firebase: [https://hugo-os-stat-function.firebaseapp.com/](https://hugo-os-stat-function.firebaseapp.com/)

As @RickCogley mentioned, you should confirm the settings in your `firebase.json` file (see mine below). Also, make sure you are running `hugo` to generate your static site **before** you run `firebase deploy`.

```auto
{
  "hosting": {
    "public": "public",
    "ignore": [
      "firebase.json",
      "**/.*",
      " **/node_modules/**"
    ]
  }
}

```

* * *

**Update:** I got this working with Wercker CI. Now everytime I do a `git push`, it will deploy the site to firebase automatically. A few notes:

- First, follow the hugo docs on [deployment with wercker](https://gohugo.io/hosting-and-deployment/deployment-with-wercker/) to link your Bitbucket account to your Wercker account, but **stop** once you get to the heading named _Use the Hugo-build Step_
- Run `firebase login:ci` locally to generate your token
- Create 2 environment variables in your wercker **build** pipeline: `FIREBASE_TOKEN` which will be the generated token from the previous step, and `FIREBASE_PROJECT_NAME` which is the name of your firebase project
- Add this (or replace your existing) `wercker.yml` file to the root of your site, then update the hugo version as desired:

```auto
box: debian
build:
  steps:
    - arjen/hugo-build:
        version: "0.50"
    - script:
        name: update apt-get
        code: apt-get update
    - script:
        name: install curl
        code: apt-get install -y curl
    - script:
        name: install gnupg
        code: apt-get install -y gnupg
    - script:
        name: install node
        code: |
          curl -sL https://deb.nodesource.com/setup_11.x | bash -
          apt-get install -y nodejs
    - script:
        name: install firebase
        code: npm install -g firebase-tools
    - devillexio/firebase-deploy@1.2.0:
        project: $FIREBASE_PROJECT_NAME
        token: $FIREBASE_TOKEN

```

For reference, here’s the [GitHub repo](https://github.com/zwbetz-gh/hugo-os-stat-test) that Wercker deploys to Firebase from.

---

_[View the full topic](https://discourse.gohugo.io/t/hugo-bitbucket-firebase/14970)._
