Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryank90/action-hugo-firebase-deploy
Github Action (Hugo Build & Deployment to Firebase).
https://github.com/ryank90/action-hugo-firebase-deploy
actions firebase github hosting hugo
Last synced: about 1 month ago
JSON representation
Github Action (Hugo Build & Deployment to Firebase).
- Host: GitHub
- URL: https://github.com/ryank90/action-hugo-firebase-deploy
- Owner: Ryank90
- Created: 2020-03-21T16:38:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-25T13:26:10.000Z (about 4 years ago)
- Last Synced: 2024-09-27T17:02:06.919Z (about 2 months ago)
- Topics: actions, firebase, github, hosting, hugo
- Language: Shell
- Homepage:
- Size: 8.79 KB
- Stars: 7
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://console.firebase.google.com/)
- 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](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets).
* 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 }}
alias: ${{ alias }} // Optional
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.