Merge pull request #220 from pingkunga/add-docker-build-and-reorder #454
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
# 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 |