• Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
Tuesday, November 17, 2026
No Result
View All Result
Subscribe Now
  • Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
    Stranded in Conflict: Palestinians Navigate the Tenuous Balance of War and Peace Amid Ceasefire Efforts

    Stranded in Conflict: Palestinians Navigate the Tenuous Balance of War and Peace Amid Ceasefire Efforts

    Trump Administration Revokes Pay Increase for Head Start Educators

    Trump Administration Revokes Pay Increase for Head Start Educators

    Unexpected Triumph: Gay Candidates Achieve Unforeseen Victories in Challenging Races

    Unexpected Triumph: Gay Candidates Achieve Unforeseen Victories in Challenging Races

    Microsoft Outlook Experiences Prolonged Outage Affecting Users Nationwide

    Microsoft Outlook Experiences Prolonged Outage Affecting Users Nationwide

    Gunfire Erupts in D.C.: Authorities Search for Suspect Amid Rising Concerns Over Public Safety

    Gunfire Erupts in D.C.: Authorities Search for Suspect Amid Rising Concerns Over Public Safety

    LAUSD Takes Strong Action Against Hate Speech Following Racial Slur Incidents

    LAUSD Takes Strong Action Against Hate Speech Following Racial Slur Incidents

    Beloved Former Los Angeles Times Columnist Steve Harvey Passes Away at 80

    Beloved Former Los Angeles Times Columnist Steve Harvey Passes Away at 80

    Exploring Diversity: ‘Ten Lives’ Showcases the Varied Economic Journeys of Americans

    Exploring Diversity: ‘Ten Lives’ Showcases the Varied Economic Journeys of Americans

    Philadelphia Eagles Facing Turmoil as Coach Nick Sirianni Addresses Controversy Over Gesture to Fans

    Philadelphia Eagles Facing Turmoil as Coach Nick Sirianni Addresses Controversy Over Gesture to Fans

  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
The Insight Post
  • Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
    Stranded in Conflict: Palestinians Navigate the Tenuous Balance of War and Peace Amid Ceasefire Efforts

    Stranded in Conflict: Palestinians Navigate the Tenuous Balance of War and Peace Amid Ceasefire Efforts

    Trump Administration Revokes Pay Increase for Head Start Educators

    Trump Administration Revokes Pay Increase for Head Start Educators

    Unexpected Triumph: Gay Candidates Achieve Unforeseen Victories in Challenging Races

    Unexpected Triumph: Gay Candidates Achieve Unforeseen Victories in Challenging Races

    Microsoft Outlook Experiences Prolonged Outage Affecting Users Nationwide

    Microsoft Outlook Experiences Prolonged Outage Affecting Users Nationwide

    Gunfire Erupts in D.C.: Authorities Search for Suspect Amid Rising Concerns Over Public Safety

    Gunfire Erupts in D.C.: Authorities Search for Suspect Amid Rising Concerns Over Public Safety

    LAUSD Takes Strong Action Against Hate Speech Following Racial Slur Incidents

    LAUSD Takes Strong Action Against Hate Speech Following Racial Slur Incidents

    Beloved Former Los Angeles Times Columnist Steve Harvey Passes Away at 80

    Beloved Former Los Angeles Times Columnist Steve Harvey Passes Away at 80

    Exploring Diversity: ‘Ten Lives’ Showcases the Varied Economic Journeys of Americans

    Exploring Diversity: ‘Ten Lives’ Showcases the Varied Economic Journeys of Americans

    Philadelphia Eagles Facing Turmoil as Coach Nick Sirianni Addresses Controversy Over Gesture to Fans

    Philadelphia Eagles Facing Turmoil as Coach Nick Sirianni Addresses Controversy Over Gesture to Fans

  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
No Result
View All Result
No Result
View All Result
Home Mobile

Publishing web apps to Firebase Hosting

by Theinsightpost
August 10, 2022
in Mobile
0 0
0
Publishing web apps to Firebase Hosting


Codemagic builds and tests your app after every commit, notifies selected team members and releases to the end user. Automatically.Get started

Written by Arnold Veltmann

Firebase Hosting provides fast and secure hosting for your web application, static and dynamic content, and microservices.

If you are interested in finding out more about what Firebase Hosting is capable of, it is recommended to take a further look at their official documentation.

In this blog post we’ll look into how we can set up Codemagic to automatically publish your web application to Firebase Hosting. While we are using a Flutter web application as an example, it is also possible to set it up with different web applications.

Set up Firebase for your project

To set up Firebase hosting for your project, you will have to add and configure a new project in your Firebase console.

  1. Navigate to the Firebase console
  2. Click Add project.
  3. Set up a name for your project.
  4. Choose whether to enable Google Analytics.
  5. Either continue or finish with Create project.

Once you have set your project up online, you will need to add Firebase hosting to your project. To do this, you will need to first install Firebase CLI on your local machine:

npm install -g firebase-tools

When using Linux or Mac, you can also install the CLI using the curl command:

curl -sL https://firebase.tools | bash

The next step is to get authenticated, for this enter this into your command line:

After entering the command, a browser window should pop up and prompt you to choose the account you wish to connect with. Select the account that you used to set up your project in Firebase console.

Now everything should be set up for adding Firebase to your project. Navigate to the root of your project and run:

Use the arrow keys to scroll to Hosting and then press space to select it.

As we want to add Firebase to our existing Flutter project, choose Use an existing project from the next menu:

From the next menu, we can again use arrow keys to navigate to the Firebase project that we have set up for using with our application and press enter to select it:

In the next step, for Flutter projects, enter build/web as your public directory (note that for non-Flutter web apps this might differ) and choose to configure as a single-page app:

Once this is done, Firebase should be successfully set up for your project locally. To confirm that, check that firebase.json and .firebaserc have been added to your project. Then push these changes to your repository.

We can now go ahead and configure Firebase hosting from Codemagic.

Set up Firebase hosting on Codemagic

In order to get your web app published after building with Codemagic, you will need to do the following:

  • Step 1. Add Firebase token to environment variables. For this you will first need to retrieve your token on the local machine, encrypt it and add it to your environment variables either in the UI or in codemagic.yaml.
  • Step 2. Set up a script for publishing to Firebase hosting. To publish your application to Firebase hosting, you will need to set up a script that publishes the app after the build is completed. This can be done in the post-build script in the UI or in codemagic.yaml.

No extra steps are needed as Codemagic virtual machines already come with Firebase CLI preinstalled.

Now let’s go through the Codemagic setup both for builds configured in the UI and in codemagic.yaml.

Encrypting your Firebase token

To get started, you will first need to retrieve your token using the command firebase login:ci which provides your token as output in the terminal after you authenticate your login in the browser.

Next, you will need to encrypt the token. You can conveniently do that in Codemagic UI.

  1. Navigate to your project in Codemagic and click Encrypt environment variables on the right sidebar (if it’s a Flutter project) or at the bottom of the page for other types of projects.

  2. Paste your token into the interface to encrypt it. Note that if you’re using the UI, encryption of the token is not necessarily needed; however, if you want to add the token to your codemagic.yaml file, this part is required so as to not expose your Firebase token when you push the file to source control.

Setting Firebase hosting up for builds configured in the UI

If you’re using the UI to configure your builds, you can add the token in App settings > Environment variables:

Then navigate further down and click on the + sign between Build and Publish. In the post-build script field, add the following script:

firebase deploy --token "$FIREBASE_TOKEN"`

Finally, save the settings. Your app will be then published to Firebase hosting the next time you build.

Setting Firebase hosting up for builds configured in codemagic.yaml

Add your encrypted token as an environment variable like this:

environment:
  vars:
    FIREBASE_TOKEN: <insert your encrypted token here>

Then add the script for publishing to Firebase hosting in the scripts section. Make sure that you add the publishing step after the building step:

- name: Publish to Firebase Hosting
  script: |
        firebase deploy --token "$FIREBASE_TOKEN"

Here is an example of a full workflow for building a Flutter web app and publishing it to Firebase hosting:

workflows:
  publish-to-firebase:
    name: Publish to Firebase hosting
    max_build_duration: 60
    environment:
      vars:
        FIREBASE_TOKEN: <insert your encrypted token here>
      flutter: beta
      xcode: latest
      cocoapods: default
    scripts:
      - flutter packages pub get
      - flutter config --enable-web
      - name: Build Web
        script: |
          flutter build web --release
          cd build/web
          7z a -r ../web.zip ./*          
      - name: Publish to Firebase Hosting
        script: |
                    firebase deploy --token "$FIREBASE_TOKEN"
    artifacts:
      - build/web.zip
      - flutter_drive.log
    publishing:
      email:
        recipients:
          - arnold@nevercode.io

To conclude

Whether you are using .yaml or UI to build your web app, setting up publishing to Firebase hosting with Codemagic is pretty straight-forward and can be easily set up in a short span of time.

When the build is successful, you can see your application published to Firebase Hosting. You can find the direct URL to the deployed build also from the log output in Codemagic UI:

✔  Deploy complete!

Project Console: https://console.firebase.google.com/project/your-project/overview
Hosting URL: https://your-project.web.app

References

Official documentation:

Codemagic documentation:

  • Environment variables – information about using environment variables with Codemagic
  • Encryption – more information about encrypting sensitive information with Codemagic
  • Using the .yaml file – documentation regarding using the ´codemagic.yaml` file to manage workflows with Codemagic

This article is written by Arnold Veltmann who’s a support engineer at Codemagic.



Source link

ShareTweetSend
Previous Post

Kenya elections 2022: Raila Odinga and William Ruto in tight race for president

Next Post

EU Ambassador to Azerbaijan congratulates Qarabagh on reaching playoffs of Champions League

Related News

Unlocking Potential: Exploring the FDE Model in Enterprise AI Solutions
Mobile

Unlocking Potential: Exploring the FDE Model in Enterprise AI Solutions

November 14, 2026
Unlocking the Scoop: Upcoming Sale Dates, Price Highlights, and Previous Bargains
Mobile

Unlocking the Scoop: Upcoming Sale Dates, Price Highlights, and Previous Bargains

November 14, 2026
Unlocking Website Security: The Marketbyte Edge in Open Source Solutions
Mobile

Unlocking Website Security: The Marketbyte Edge in Open Source Solutions

November 13, 2026
Uncovering the Best Solutions for Your Mobile Risk Concerns
Mobile

Uncovering the Best Solutions for Your Mobile Risk Concerns

November 12, 2026
Next Post
EU Ambassador to Azerbaijan congratulates Qarabagh on reaching playoffs of Champions League

EU Ambassador to Azerbaijan congratulates Qarabagh on reaching playoffs of Champions League

Discussion about this post

Subscribe To Our Newsletters

    Customer Support


    1251 Wilcrest Drive
    Houston, Texas
    77042 USA
    Call-832.795.1420
    e-mail – news@theinsightpost.com

    Subscribe To Our Newsletters

      Categories

      • Africa
      • Africa-East
      • African Sports
      • American Sports
      • Arts
      • Asia
      • Australia
      • Business
      • Business Asia
      • Business- Africa
      • Canada
      • Defense
      • Education
      • Egypt
      • Energy
      • Entertainment
      • Europe
      • European Soccer
      • Finance
      • Germany
      • Ghana
      • Health
      • Insight
      • International
      • Investing
      • Japan
      • Latest Headlines
      • Life & Living
      • Markets
      • Mobile
      • Movies
      • New Zealand
      • Nigeria
      • Politics
      • Scholarships
      • Science
      • South Africa
      • South America
      • Sports
      • Tech
      • Travel
      • Travel-Africa
      • UK
      • USA
      • Weather
      • World
      No Result
      View All Result

      Recent News

      Gators Shock Wildcats 21-14 in Thrilling Upset Amid Rollercoaster Season

      Gators Shock Wildcats 21-14 in Thrilling Upset Amid Rollercoaster Season

      November 15, 2026
      Government Announces Historic  Billion Investment in Energy Infrastructure Development

      Government Announces Historic $2 Billion Investment in Energy Infrastructure Development

      November 15, 2026
      Notre Dame Postgame Insights: Dive into Superchats with Westwood One Sports

      Notre Dame Postgame Insights: Dive into Superchats with Westwood One Sports

      November 15, 2026
      Transform Your Laptop Setup with These 5 Affordable Accessories

      Transform Your Laptop Setup with These 5 Affordable Accessories

      November 15, 2026
      • Home
      • Advertise With Us
      • About Us
      • Corporate
      • Consumer Rewards
      • Forum
      • Privacy Policy
      • Social Trends

      Theinsightpost ©2026 | All Rights Reserved. Theinsightpost is an Elnegy LLC company, registered in Texas, USA

      Welcome Back!

      Login to your account below

      Forgotten Password?

      Retrieve your password

      Please enter your username or email address to reset your password.

      Log In

      Add New Playlist

      We are using cookies to give you the best experience on our website.

      You can find out more about which cookies we are using or switch them off in .

      No Result
      View All Result
      • Home
      • Insight
      • Blog
      • Business
      • Entertainment
      • Health
      • Politics
      • Shop
        • Gift Shop
        • Value Shop
        • Store
        • Bargain Shop
        • Discount
      • Sports
      • Tech
      • Travel
      • USA
      • Video
      • World
        • Asia
        • Africa
        • South America
        • North America
        • Europe
        • Oceania

      Theinsightpost ©2026 | All Rights Reserved. Theinsightpost is an Elnegy LLC company, registered in Texas, USA

      The Insight Post
      Powered by  GDPR Cookie Compliance
      Privacy Overview

      This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

      Strictly Necessary Cookies

      Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

      Cookie Policy

      More information about our Cookie Policy