Skip to content

Instantly share code, notes, and snippets.

@maxkostinevich
Created January 1, 2020 20:37
Show Gist options
  • Save maxkostinevich/2b3ddc50df73dd3979f92498edc6d3bc to your computer and use it in GitHub Desktop.
Save maxkostinevich/2b3ddc50df73dd3979f92498edc6d3bc to your computer and use it in GitHub Desktop.
Github Actions - Deploy Jigsaw to Github Pages
# Learn more at https://maxkostinevich.com/blog/deploy-jigsaw-using-github-actions
name: Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Install NPM Dependencies
run: npm install
- name: Install Composer Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Build website
run: npm run production
- name: Prepare production
run: |
git config --global user.email "YOUR@EMAIL"
git config --global user.name "YOUR NAME"
git add build_production -f && git commit -m "Build for deploy"
- name: Deploy website
run: |
git remote set-url origin https://${{secrets.DEPLOY_KEY}}@github.com/YOUR_USERNAME/REPOSITORY_NAME.git
git subtree split --prefix build_production -b gh-pages
git push -f origin gh-pages:gh-pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment