{"id":15184498,"url":"https://github.com/ryank90/action-hugo-firebase-deploy","last_synced_at":"2025-10-26T23:30:28.810Z","repository":{"id":65158402,"uuid":"249017516","full_name":"Ryank90/action-hugo-firebase-deploy","owner":"Ryank90","description":"Github Action (Hugo Build \u0026 Deployment to Firebase).","archived":false,"fork":false,"pushed_at":"2020-09-25T13:26:10.000Z","size":9,"stargazers_count":8,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T00:51:06.524Z","etag":null,"topics":["actions","firebase","github","hosting","hugo"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ryank90.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-21T16:38:43.000Z","updated_at":"2024-10-05T18:40:38.000Z","dependencies_parsed_at":"2023-01-05T04:49:35.588Z","dependency_job_id":null,"html_url":"https://github.com/Ryank90/action-hugo-firebase-deploy","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.4285714285714286,"last_synced_commit":"c232782be442e00ef7e0fe7a0de518916d1d4f1e"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryank90%2Faction-hugo-firebase-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryank90%2Faction-hugo-firebase-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryank90%2Faction-hugo-firebase-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryank90%2Faction-hugo-firebase-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ryank90","download_url":"https://codeload.github.com/Ryank90/action-hugo-firebase-deploy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238408600,"owners_count":19467132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","firebase","github","hosting","hugo"],"created_at":"2024-09-27T17:02:29.422Z","updated_at":"2025-10-26T23:30:28.410Z","avatar_url":"https://github.com/Ryank90.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Github Action (Hugo Build \u0026 Deployment to Firebase)\n\nThe following Github Action will successfully build and deploy your Hugo static-site and upload it to Google Firebase Hosting.\n\n**Pre-requisites**\n\n- You will need a Firebase Project. If you haven't already got one you can easily get one here: [Firebase Console](https://console.firebase.google.com/)\n- You will need a Google Service Account setup in-order for your site to be successfully deployed. See below on how to set one up.\n\n## Manually configure the service account\n\n### 1. Create a service account that the action will use to deploy to Hosting\n\n1. Visit the [GCP Service Accounts page](https://console.cloud.google.com/iam-admin/serviceaccounts) and make sure the correct project (same name as your Firebase project) is selected in the top blue bar\n1. Click the \"+ CREATE SERVICE ACCOUNT\" button\n1. Give the service account a name, id, description. I recommend something like `github-action-\u003cmy repository name\u003e`\n1. At the \"Grant this service account access to project\" step, choose the following [roles](https://firebase.google.com/docs/projects/iam/roles-predefined-product) that the service account will need to deploy on your behalf:\n   - **Firebase Authentication Admin** (Required to add preview URLs to Auth authorized domains)\n     - `roles/firebaseauth.admin`\n   - **Firebase Hosting Admin** (Required to deploy preview channels)\n     - `roles/firebasehosting.admin`\n   - **Cloud Run Viewer** (Required for projects that [use Hosting rewrites to Cloud Run or Cloud Functions](https://firebase.google.com/docs/hosting/serverless-overview))\n     - `roles/run.viewer`\n   - **API Keys Viewer** (Required for CLI deploys)\n     - `roles/serviceusage.apiKeysViewer`\n1. Finish the service account creation flow\n\n### 2. Get that service account's key and add it to your repository as a secret\n\n1. [Create and download](https://cloud.google.com/iam/docs/creating-managing-service-account-keys#creating_service_account_keys) the new service account's JSON key\n1. Add that JSON key [as a secret in your GitHub repository](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository). I recommend a name like `FIREBASE_SERVICE_ACCOUNT` but ensure it has been base64 encoded before saving. You can do this on MacOS by running `cat {file_name}.json | base64` in Terminal and copying the output into Github.\n\n## Getting Started\n\n* Ensure you've followed the above steps to setup your service account.\n* 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.\n* In the root of your Hugo project, initialize the Firebase project with the `firebase init` command. From here:\n  * Choose Hosting in the feature question\n  * Choose the project you just set up\n  * Accept the default for your database rules file\n  * Accept the default for the publish directory, which is public\n  * Choose “No” in the question if you are deploying a single-page app\n* You will now have everything setup within your repo to deploy successfully to Firebase.\n* Once completed you are ready to setup your action.\n\n## Setting up Actions\n\nWithin your repo select the `Actions` tab. Create a new workflow and paste the following code:\n\n```\non: [push]\nname: Deploy Hugo to Firebase\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v1\n      with:\n        submodules: true\n    - uses: ryank90/action-hugo-firebase-deploy@master\n      with:\n        firebaseServiceAccount: ${{ secrets.firebase_service_account }}\n        projectId: ${{ secrets.firebase_project_name }}\n        hugoParams: -D\n```\n\nSave and you are ready to push code to your repo and have it automatically deployed.\n\n## Options\n\n`firebaseServiceAccount` _{string}_ required\nThis is a Google service account JSON key that has been base64 encoded. Once you have got your JSON key configured and downloaded you can run `` on your mac to base64 encode it ready for uploading into Github.\n\nIt's important to ensure you set this up as an encrypted secret within Github. You can do that here: https://github.com/USERNAME/REPOSITORY/settings/secrets.\n\n`projectId` _{string}_\nThis is your Firebase project ID that can be found from within the Firebase console.\n\n`hugoParams` _{string}_\nThese are your hugo parameters that you would like to pass. It defaults to `-D` which will built your site ready for deployment although you can pass further parameters. See Hugo documentation for more information on what is available here.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryank90%2Faction-hugo-firebase-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryank90%2Faction-hugo-firebase-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryank90%2Faction-hugo-firebase-deploy/lists"}