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 }} |
This works like a charm, except I had an error with not being able to find the public folder when in the deploying stage, so I had to add "path: public" to the deploy stage too to fix that.
run: yarn gatsby build
path: public
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 gatsby 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
path: public
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
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.
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?
Quite helpful, thanks for sharing!