Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Jigsaw auto deployment to GitHub Pages
name: Auto-deploy
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
# This workflow contains a single job called "deploy"
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Install Composer Dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Install NPM Dependencies
run: npm install
- name: Build Site
run: npm run production
- name: Commit Site
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add build_production && git commit -m "Build for deploy"
- name: Publish Site
run: |
git subtree split --prefix build_production -b gh-pages
git push -u origin gh-pages --force
git branch -D gh-pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.