Created
January 1, 2020 20:37
-
-
Save maxkostinevich/2b3ddc50df73dd3979f92498edc6d3bc to your computer and use it in GitHub Desktop.
Github Actions - Deploy Jigsaw 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
# 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