I just installed the “Reditory” theme from @GBJsolution, and setup a GitHub Action to automate deploying to a site, so I thought I’d share it.
It assumes the entire contents of the zip file you download from themeforest (the documentation, development, demo data, etc folders) are all pushed to your repo as-is.
It builds the environment per the Reditory docs (thanks for providing great docs for all your themes), then uses the Ghost action (thanks Ghost team!) to deploy the updated zip file to the Ghost site.
You can still make changes and build locally on your machine, and then commit things when you’re ready (I added a .gitignore
file for the build
and dist
folders). Maybe it’ll be useful for someone else too. Also, if you see any obvious ways to streamline this that’ll shave off a few seconds, I’d love to hear it - even so, it runs in under a minute.
name: Deploy Theme to Ghost
on:
push:
branches:
- master
jobs:
deploy:
name: Deploy Theme to Ghost
runs-on: ubuntu-18.04
steps:
- name: checkout master
uses: actions/checkout@master
- name: use node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: install dependencies and build theme
run: |
cd development/reditory
npm install gulp-cli -g
npm install
gulp build
gulp zip
- name: deploy theme
uses: TryGhost/action-deploy-theme@v1.4.1
with:
api-url: ${{ secrets.GHOST_ADMIN_API_URL }}
api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}
file: development/reditory/dist/reditory.zip