-
Notifications
You must be signed in to change notification settings - Fork 102
36 lines (32 loc) · 1.24 KB
/
publish-to-github-pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# credit https://medium.com/better-programming/deploy-your-gatsby-site-with-github-actions-e761ea93813f
# https://github.com/enriikke/gatsby-gh-pages-action/blob/main/README.md
name: Publish Gatsby to GitHub pages
on:
push:
branches:
- main
jobs:
build_and_deploy_job:
runs-on: ubuntu-latest
env:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_SEARCH_KEY: ${{ secrets.ALGOLIA_SEARCH_KEY }}
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
NODE_VERSION: 14.x
steps:
- uses: actions/checkout@master
# https://github.com/actions/setup-node
- name: Use Node.js version ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- name: Bypass Open SSL issue
run: |
export NODE_OPTIONS=--openssl-legacy-provider
- uses: enriikke/gatsby-gh-pages-action@v2
# https://github.com/enriikke/gatsby-gh-pages-action/releases
# source https://github.com/enriikke/gatsby-gh-pages-action/blob/main/index.ts
with:
# access-token is a GitHub Personal access token with the "repo" scope
access-token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
deploy-branch: gh-pages