Last active
July 5, 2021 13:57
-
-
Save siriwatknp/bd318485d5b0c12049be258997ad0093 to your computer and use it in GitHub Desktop.
Github actions for Gatsby + firebase hosting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
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
Hi guys, I have a question. How would be with an extra env key? i tried likes this:
env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} CONTENFUL_API_KEY: ${{ secrets.CONTENFUL_API_KEY }}.
And I just couldn't make it work...
I got this message: "accessToken" is required github actions dev ...
Of course, I added it to "secrets". Thanks.