Skip to content

Instantly share code, notes, and snippets.

@siriwatknp
Last active July 5, 2021 13:57
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save siriwatknp/bd318485d5b0c12049be258997ad0093 to your computer and use it in GitHub Desktop.
Github actions for Gatsby + firebase hosting
name: Build and Deploy
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: yarn
- name: Build
run: yarn build
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: public
path: public
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: public
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
@BorisBosnar
Copy link

Hey guys,
I am using reCAPTCHA v3 on my Gatsby website and need to pass the API key to the component. For this I wanted to use the Secrets from Github Actions but where do I have to position the env variable in the action.yml so that I can retrieve it in Gatsby with process.env.RECAPTCHA_API_KEY?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment