Using Github Actions to deploy theme updates to Ghost Pro

I’m new here and wanted to share something with the community to help others learn to set up the theme auto-deploy GitHub action.

It’s important to note that if you are using Ghost Pro hosting and attempting to use the “stock” GitHub actions file displayed here, you will also need to add a step to convert your theme files into a zip file.

Here’s how to do it in the deploy-theme.yml file.

`name: Deploy Theme
- master
- main
runs-on: ubuntu-latest
- name: Checkout code
uses: actions/checkout@v4

  - name: Zip theme files
    run: zip -r .

  - name: Deploy Ghost Theme to Ghost Pro
    uses: TryGhost/action-deploy-theme@v1
      api-url: ${{ secrets.GHOST_ADMIN_API_URL }}
      api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}
      theme-name: "Custom Theme"
      file: ./


Additional notes:

  • When setting up the github repo, I placed the package.json at the same level as the index.hbs file so you will notice that we are running the zip command at the root level of the directory.