Last active
May 30, 2022 09:10
-
-
Save milon/5173255b58564a0e50548cfbe879181e to your computer and use it in GitHub Desktop.
Github Action with Jigsaw
This file contains hidden or 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: 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 "[email protected]" | |
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 |
This file contains hidden or 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
#!/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