Zipping theme github actions

Hello everyone,

I have a question about auto-deploying with github actions. I have a working website on a digitalocean droplet, and i have added the default theme to a github repository with github actions configured so i can make local changes to the theme and by committing it wil automatically update my website.

Everything seems to work, except the github actions steps. First i had an error saying i need a zip file, so i searched this forum and changed the deploy-theme.yml to automatically zip my theme content. But now i get this error:

every step must define a uses or run key

I am confused what the config file should look like, i would appreciate some help. Thanks in advance!

name: Deploy Theme
on:
  push:
    branches:
      - master
      - main
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Zip theme files
      - run: zip -r theme.zip .
      - name: Deploy Ghost Theme
        uses: TryGhost/action-deploy-theme@v1
        with:
          api-url: ${{ secrets.GHOST_ADMIN_API_URL }}
          api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}
          theme-name: "lennartvantuijl"
          file: ./theme.zip

Try this:

name: Deploy Theme
on:
  push:
    branches:
      - master
      - main
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Zip theme files
        # You had a `-` in front of this line!
        run: zip -r theme.zip .
      - name: Deploy Ghost Theme
        uses: TryGhost/action-deploy-theme@v1
        with:
          api-url: ${{ secrets.GHOST_ADMIN_API_URL }}
          api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}
          theme-name: "lennartvantuijl"
          file: ./theme.zip
1 Like

Yes it worked, i also had to change my theme in ghost settings but my local changes to the theme are visible. Thank you very much!