action-hosting-deploy icon indicating copy to clipboard operation
action-hosting-deploy copied to clipboard

Using this action with a self-hosted runner

Open mwhitaker opened this issue 5 years ago • 1 comments

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. 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:

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 led me to the solution. Anyway, hope this saves folks a couple of minutes here or there.

mwhitaker avatar Nov 13 '20 18:11 mwhitaker

Interesting, thanks for sharing this @mwhitaker!

jhuleatt avatar Dec 23 '20 18:12 jhuleatt