Skip to content

Instantly share code, notes, and snippets.

@milon
Last active May 30, 2022 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save milon/5173255b58564a0e50548cfbe879181e to your computer and use it in GitHub Desktop.
Save milon/5173255b58564a0e50548cfbe879181e to your computer and use it in GitHub Desktop.
Github Action with Jigsaw
name: Build & Publish
on:
push:
branches:
- develop
schedule:
- cron: "0 2 * * 1-5"
jobs:
build-site:
runs-on: ubuntu-latest
steps:
- 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 assets
run: npm run production
- name: Build Jigsaw site
run: ./vendor/bin/jigsaw build production
- name: Create CNAME File
run: echo "milon.im" >> build_production/CNAME
- name: Stage Files
run: git add -f build_production
- name: Commit files
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git commit -m "Build for deploy"
- name: Publish
run: |
git subtree split --prefix build_production -b master
git push -f origin master:master
git branch -D master
#!/usr/local/bin/zsh
npm run prod
./vendor/bin/jigsaw build production
git add build_production
git commit -m "Build for deploy"
git subtree push --prefix build_production origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment