Created
May 5, 2020 17:38
-
-
Save johannesberdin/06688d1055f70f0addbed8fc30789111 to your computer and use it in GitHub Desktop.
Jigsaw auto deployment to GitHub Pages
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: 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