GitHub Pages
For an easier and recommended way to publish your Plasmic project, consider Plasmic hosting.
Set up GitHub Pages
Note this workflow depends on github-pages-deploy-action by JamesIves.
- Create an empty branch called
gh-pages
. We recommend following this GitHub Gist from ramnathv. - Navigate to your GitHub Pages settings. In your repository, click “Settings” and, under “Code and automation”, click “Pages”.
- Set up your “Build and deployment” information.
- For “Source”, choose “Deploy from a branch”.
- For “Branch”, choose your newly created
gh-pages
branch and the ”/ (root)” directory. - Click “Save”.
- Enter your custom domain name and follow the GitHub Pages instructions for configuring a custom domain and click “Save”.
- (Recommended) Check “Enforce HTTPS”.
- Add a
.github/workflows/plasmic-push.yml
file with the following content to themain
branch:
name: Build and deploy Plasmic appon:push:branches:- mainjobs:job:name: Build and deployruns-on: ubuntu-lateststeps:- id: checkoutname: Check out repositoryuses: actions/checkout@v2with:persist-credentials: falsefetch-depth: 0- id: nodename: Set up node v16uses: actions/setup-node@v2with:node-version: '16'- id: cachename: Recover cacheuses: actions/cache@v2with:key: lock-${{ hashFiles('package-lock.json', 'yarn.lock') }}path: node_modules- id: buildname: Build Plasmic appuses: plasmicapp/plasmic-action@masterwith:run: buildbranch: mainskip_if_plasmic: true- id: gh-pagesname: Publish to GitHub Pagesuses: JamesIves/github-pages-deploy-action@4.1.0if: ${{ steps.build.outputs.publish_dir }}with:branch: gh-pagesfolder: ${{ steps.build.outputs.publish_dir }}
Was this page helpful?
Have feedback on this page? Let us know on our forum.