Skip to content

Instantly share code, notes, and snippets.

@Breta01
Created January 9, 2022 01:50
Show Gist options
  • Save Breta01/a37678dcd31ed7a3f7b7b06432aa6c8a to your computer and use it in GitHub Desktop.
Save Breta01/a37678dcd31ed7a3f7b7b06432aa6c8a to your computer and use it in GitHub Desktop.
Deploying your decentralized application to GitHub Pages
# This workflow will build 'client' folder, test and deploy to github pages on branch gh-pages
# For more information see:
# - https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# - https://github.com/marketplace/actions/deploy-to-github-pages
name: Build and Deploy Frontend
on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout ๐Ÿ›Ž๏ธ
uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: '16.x'
cache: 'yarn'
cache-dependency-path: './client/yarn.lock'
- name: Install dependencies
working-directory: ./client
run: yarn install --frozen-lockfile
- name: Build ๐Ÿ”ง
working-directory: ./client
run: PUBLIC_URL="." yarn build
- name: Deploy ๐Ÿš€
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./client/build # The folder which will be deployed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment