FirebaseExtended / FirebaseExtended/action-hosting-deploy
Using this action with a self-hosted runner
- Dominant language
- TypeScript
- Stars
- 809
- Forks
- 232
- PR merge metrics
- No merged PRs in 30d
Description
Thanks a lot for this great action. It's been working great out-of-box with GitHub-hosted runners, but just wanted to give a tip if you use a [self-hosted runner](https://docs.github.com/en/free-pro-team@latest/actions/hosting-your-own-runners/about-self-hosted-runners). In my case I set up the runner on a VM based on `Ubuntu 18.04` and I could only get the action to run if I set `npm install --unsafe-perm -g firebase-tools` or `npm config set unsafe-perm true` in a previous step:
```yaml
name: Deploy to Preview Channel
on:
pull_request:
# Optionally configure to run only for specific files. For example:
# paths:
# - "website/**"
jobs:
build_and_preview:
# runs-on set to self-hosted instead of ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
# To get firebase-tools to install properly, add the following build step:
- run: npm config set unsafe-perm true
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
expires: 30d
projectId: your-Firebase-project-ID
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
```
I am not sure if this is true in general for self-hosted runners or is specific to `firebase-tools`, but this [issue](https://github.com/firebase/firebase-tools/issues/1814) led me to the solution. Anyway, hope this saves folks a couple of minutes here or there.
Contributor guide
Assessment
This issue has not been assessed yet.