Skip to main content
  1. Blogs/

Effortless Hugo Deployment to Firebase Hosting with GitHub Actions

·215 words·2 mins
Development GitHub Actions Hugo Firebase Hosting Automation
Lupus Tungsten
Author
Lupus Tungsten
I’m Lupus, from Dresden, Germany. I write about personal development, fitness, and life’s big questions, blending raw reflections with practical insights. Join me as I explore what it means to live intentionally! 😊

Venturing a bit off my usual agile and personal development path, I’m sharing a gem for developers facing the same challenge: automating Hugo deployments to Firebase Hosting with GitHub Actions.

After battling with firebase-tools, digging through GitHub’s docs, troubleshooting countless failed attempts, and even bouncing ideas off Copilot, I finally cracked it! I got my Hugo site, powered by the hugoplate theme, to deploy seamlessly. Since this took way more time than I’d like to admit, I’m thrilled to share my working solution to save you the headache.

Below is the battle-tested GitHub Actions workflow that gets the job done. Feel free to adapt it to your project, and let me know how it works for you! If you find this helpful, I’d love for you to share it with your dev colleagues or explore my other posts on agile leadership, scrum mastering, or coaching. Spreading useful knowledge is what fuels our community!

name: Build and Deploy
on: 
  push:
    branches: [main]

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: true
          fetch-depth: 0

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'
          extended: true

      - uses: actions/setup-node@v4
        with:
          node-version: 18

      - run: npm run build  # runs hugo

      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: '${{ secrets.GITHUB_TOKEN }}'
          firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_SECRET }}'
          channelId: live-or-what-you-want
          projectId: your-project-id