Skip to content

Instantly share code, notes, and snippets.

@SanchitB23
Created April 14, 2020 13:36
Show Gist options
  • Save SanchitB23/6f41b796c7fed135870f942a2095913b to your computer and use it in GitHub Desktop.
Save SanchitB23/6f41b796c7fed135870f942a2095913b to your computer and use it in GitHub Desktop.
YAML script file to create custom Actions Workflow in GitHub to deploy and add prod keys to website
name: Deploy to GitHub Pages
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build
run: |
npm install
npm run-script build
env:
REACT_APP_TOKEN: ${{ secrets.REACT_APP_TOKEN }} //Add token like this secrets.token is token you add in github secrets which will be accessible by process.env.token_name
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment