Created
April 14, 2020 13:36
-
-
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
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: 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